• Content count

  • Joined

  • Last visited

Community Reputation

344 Neutral

About ScoreX

  • Rank
  1. I'm struggling to see how you got a KeyError for this, unless you're doing something exotic ( in which case I'll need more code ).   Anyway, instead looping through a list and remove elements in the for loop, you should instead try one of the below: Loop through a copy of the list of bubbles, removing from them from the original list ( for bubble1 in bubbles[:]: ) Loop through the list using an iterator ( for bubble1 in iter(bubbles): )   Also, you don't need to set bubble_old = bubble1. When you remove old_bubble from the list, you still hold the reference to it ( old_bubble is referenced to bubble1 ). def touching(self, bubble, bubbles): for bubble1 in bubbles[:]: if self.color == bubble_old.color and dist(bubble.pos, bubble1.pos) <= 2 * BUBBLE_RADIUS: bubbles.remove(bubble1) self.touching(bubble1, bubbles)
  2. JMenu, Listeners, and drawing

    In the actionPerformed method of the ImageListener class, you are comparing the text of the event source to the JMenuItem object, instead of the text of the object.   Instead of if(imageName.getText().equals(image1)) { outputTextArea.replaceRange(descriptions[0], 0, outputTextArea.getText().length()); pictureLabel.setIcon(new ImageIcon("images/" + pictures[0])); } Try if(imageName.getText().equals(image1.getText())) { outputTextArea.replaceRange(descriptions[0], 0, outputTextArea.getText().length()); pictureLabel.setIcon(new ImageIcon("images/" + pictures[0])); }
  3. playing sounds in python 3 lists downloads for 3.2 and 3.3   Are you sure you've setup the right interpreter in pycharm? It's easy to forget if you've got multiple virtualenvs on the go.
  4. The main difference is in the name... One takes place in real time, while the other takes place in turns.   In terms of programming, the difference is that for RTS you will need to be constantly updating/drawing. For TBS, you only need to update when something occurs e.g player hits end turn, so now we calculate the next AI players moves.   Have you played a Total War game? It's pretty obvious how they make use of both systems. The turn-based portion takes place on a large world map, where you move your armies and create castles/cities and the real-time bit is for battles where you fight on a smaller map with 2 or more armies.
  5. The Pygrid Engine (Pygame)

    Looks like a good start   Just some feedback on your code style: For modules, classes, methods and functions you might want to use python docstrings instead of using '#'. A docstring is much more useful as any decent IDE can show it to you without you needing to visit the file to read the comment. It's generally not good python style to use import *. Better to import exactly what you need so there is no ambiguity. ( e.g, the "init" function in, where is that defined? Is it pygame, random or pygrid? ( I know it's pygame in this script, but as your codebase grows bigger, you might want to provide your own init()  ) ) I know it's only a demo script, but all the "global" code in would look a lot nicer grouped into a function ( or an if __name__ == "__main__" ), just to make it more readable. As it is, you kinda need to jump around to follow the code.   You don't have to take any of this on board of course, the code will work regardless. At work we develop primarily in python and it's great working with clean documented code when using 3rd party packages. These would be things I would be looking out for if I was searching for a python engine to use making a game.   All the best with this endeavour
  6.   Actually, AMD have recently added support for 4.3       I haven't tried the downloaded version, but the online version of arcsynthesis does have small snippets that are fully explained. Atleast, I did find it easy enough to understand, even when using it with OpenTK.
  7. c#

    He is talking about C# 5 which does exist as it was released with .net 4.5     As for which book to get, it's difficult to say. I would look at reviews for both and see what people have to say. Keep in mind that neither choice is a wrong choice. I would recommend going for the version 4 book ( it'll probably be cheaper ) unless the newer copy happens to teach it in a better way. You can always use web resources once you've finished learning the features in version 4 to learn version 5 afterwards.   As for Visual Studio versions, you can always use the latest Express Edition which will allow you to use features from the newer version of the language for free at
  8. Its been a while now since I used Code::Blocks, but if I remember correctly, you need to press Ctrl+Space to open up the code hinting feature
  9. Need help with Menu

    You could try this. Sorry for it being in C++, i'm not too familiar with C. But looking at it you will get the general idea I hope. [code]#include <iostream> using namespace std; int MenuOptions(); void DoMenu(); int main(int argc, char** argv) { DoMenu(); return 0; } int MenuOptions() { int option; cout << "\t1. Start Game" << endl; cout << "\t2. Tutorial" << endl; cout << "\t3. Credits" << endl; cout << "\t4. Exit Game" << endl; cout << "\t\t Enter choice: "; cin >> option; return option; } void DoMenu() { bool finished = false; while(!finished) { int option = MenuOptions(); switch(option) { case 1: //Start New Game break; case 2: //Start Tutorial break; case 3: //Credits break; case 4: finished = true; break; } } }[/code]