Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

622 Good

About pixelartist

  • Rank
  1. pixelartist

    Environment for Python?

    Hi cgeo,   If you're using Windows, you can use the IDLE IDE that ships with Python. It's not the most beautiful thing in the world, but it's already there. Just open it up and create a new file with it. You can run it natively in IDLE, so that's a good start.   If you're not on a Windows machine or you don't like IDLE (I wouldn't blame you, really), then you need to create and edit your Python programs in a text editor. I personally prefer SublimeText, but Notepad++ works just as well. Just save your file with a ".py" extension. To run a Python program on Windows, you can either navigate to the file in Windows Explorer and run it - this will open up the command line like you've already seen, or you can (and this is my personal preference) right click on it, "Edit with IDLE" and run it from there. It's not the most elegant solution, but IDLE provides good feedback on errors and won't just close when the program terminates for one reason or another. If you're on a Mac or *NIX, open up a terminal and run "python filename.py" where "filename" is whatever you named your file (prepended by the directory it's not in your current working directory).   I hope this helps!
  2. pixelartist

    Pygame importing images

    You just need to make sure you know where the root folder of your game is - i.e. make sure you know the structure of the files and folders and they are all contained in a single folder. Say you have "C:\Users\user\Desktop\Game" and the entirety of your game, including the images and code, are in Game. Say your code is in "Game\code" and your image is in "Game\images\Entities", you can load the image with the following:   image = pygame.image.load("..\\images\\Entities\\image.png") Where the ".." tells the computer to check what directory you're in right now and go up one level - in this case, the computer sees you're in the code directory, goes up to the Game directory, then follows the remaining path. If the image is in a subdirectory of the directory the code is in, just use a single ".". If you need to go up multiple directories, add a "..\\" for each level you need to go up. That way it doesn't matter where on the computer the entire folder is stored, as long as the files are in the same position relative to one another.
  3. If you're not absolutely set on teaching BASIC, but just some form of programming, this ebook does a nice job of explaining the basics of Python, which is fairly intuitive and more modern than BASIC: http://inventwithpython.com/chapters/ For a clean, up-to-date version of BASIC, without any sort of compiler or OS, you can use a programmable graphing calculator - my first programming was on a slightly older version of this one (I can't find the exact model number of the one I used, but this one is close): https://www.google.ca/search?q=casio+graphing+calculator&oq=casio+graphing+calculator&aqs=chrome..69i57j0l5.10151j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=casio%20cfx-9850gb%20plus You can find some instructions on how to use it here: http://support.casio.com/pdf/004/fx_plus_chapter20.pdf
  4. pixelartist

    Best place to learn C++

    Python's syntax really isn't that different when you get down to it. It's a little more intuitive in my opinion, and it'll be a nice stepping stone for you. It certainly doesn't spoon-feed you, but it's not as finicky as many other languages, so it should help you to get a handle on things without overly aggravating you. Good luck!
  5. Just spitballing here - not sure if it fits with your game, but wouldn't grenades be the ideal weapon for the AI to use if the player tried concentrating their troops and not moving them?
  6.   Does this mean you don't know how to program? If so, starting your programming career with modifying the engine to be "really good" is just going to frustrate you. These engines (including TORQUE 3D) are horribly complex and have taken teams of highly skilled people ages to put together. If you want to make a game using a prebuilt engine, it's probably in your best interest to just use the engine as it is - and even then it's going to take a lot of work. If you're still looking for C++ tutorials, try www.cplusplus.com. It's not going to tell you how to modify to the source code of any game engines, but if you're just starting out, you're probably months (or more likely years) of full-time study and practice away from understanding enough to make the changes you want. It's a hard truth, I know, but one you're going to have to live with.
  7. pixelartist

    Beginner in Programming for games help please

    This gets asked quite a bit. There is no <i>best</i> language. There is a best language for <i>you</i>, but that's not necessarily going to be the same for everyone else. Try picking a language, look up [language name] tutorial on Google, and go from there. If you like that language, go with it. If not, try another one. It might be a good idea to look at why some people like a language, or why it was developed - was it designed to give the programmer intimate control over the system, but it wasn't supposed to be user-friendly? Was it meant to get the most out of expensive programmers while relinquishing control of the system and perhaps wasting memory or processor time? These are some questions you might want to ask yourself when picking a language or moving forward. A game won't just happen overnight. You're going to have to spend a lot of time on the basics of any language you choose before you get to anything you might consider a game, so you'll just have to stick with it. Also, there's a difference between enjoying playing games and enjoying making them. Don't get aggravated, discouraged or confused if you don't immediately take to the game development process, it happens. Try to stick with it, ask questions if you get stuck, take a break, come back to it, try a different approach. It's a challenge, but it's not for everyone.   Good luck!
  8. pixelartist

    Randomly generated circles in pygame.

    The pygame draw function returns a Rect, so blit the Rect onto the screen Surface after the other shape has been blitted.
  9. pixelartist

    Randomly generated circles in pygame.

    It would probably be a good exercise for you to figure out. Use what FLeBlanc gave you as well as http://docs.python.org/2/library/random.html#random.randint.
  10. pixelartist

    Need help with pygame images.

    Does the Pygame distribution you're using support .png file formats? Try saving it as a .bmp and open that file. .bmp images are always going to be supported (according to the people maintaining Pygame) but other file formats may not be, or may go in and out of support.
  11. pixelartist

    Need help with pygame images.

    The \t is a tab character (you can see it in your error message). Be sure to escape your \ characters when using them in strings with \\ or you'll end up with weird errors like that.   An easier way to keep your image files would be to have a standard location for them, hardcode that path in, then just concatenate the strings when you reference a file, so you won't have to worry about remembering to escape those pesky \ characters as often.   i.e. IMAGE_PATH = "C:\\User\\Documents\\python images\\" background = pygame.image.load(IMAGE_PATH + "example.bmp").convert()
  12. pixelartist

    Illegal Instruction, possible causes?

    Illegal instructions are operating system generated exceptions that (outside of errors caused by bad programming - ie referencing a function pointer to some garbage space in memory) are generally machine-specific. I'm not familiar with OpenGL, but perhaps you have it or your compiler configured for a different machine setup. Are you compiling on your laptop and trying to run on your desktop? Since it happens on your first API call I can only imagine OpenGL is configured to your laptop machine, and it's likely that the compiler is generating a system call that isn't available or isn't the same on your desktop The glEnable()/glDisable() functions probably don't generate the same system call, so they won't cause the exception (assuming this is the real reason). Try re-configuring and recompiling on your desktop.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!