• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Game Development Questions

  • 1
    Posts
    16
    Years
    • Seen Apr 17, 2009
    Okay so before you rant about how you think I'm a huge fag, I'm 23 and I want to make games! Okay now I know a good bit about Java programming of course still at Novice level but I know enough to teach someone the basics. I'm mainly having trouble with the whole concept of a GAME. So my major question is where would I start (obviously once I know the answers to the other questions I have). I have no clue where to start, I know what I want to do, I have a good storyline in my head but I don't have the first clue as to how to put it together. Do I start on the main class? Do I start with the player's image? Do I make a GUI first? You see what I'm getting at?

    Okay so yeah thats my major question but I need these questions answered as well

    - What is the best way to make a customizable GUI. I know both "java.applet.Applet;" and Swing. Swing for me is the easist to "customize" but I don't have the first clue as to how to add images and key events ect into the GUI.

    - I keep having problems with moving the image around. My key events don't seem to work. I made a public void for them, I tried some other way that was really stupid and I still cant get all my key events to work. I can get them to do this "System.out.println("Left Key")" and they work but when I try to add something like x_pos++ or x_pos-- it wont do anything!

    - This question is for later but how would I make it so that when objects collide they do something or if an object is near something and a button is pressed how would I make it do a selected event, and also would I need an extra class for that (ie. NPC's)

    - Would using cases for items and NPC's be a good idea?

    I know those sound like kiddie questions but what would be the point of calling me a noob and telling me to google it? If you can answer at least ONE of these questions please do so. That would so much easier for me. Every time I get on forums and ask a question people never answer them or they talk to me like I already know what I'm doing. So for once in my life I'm actually going to ask you to talk to me like a first grader.

    Thanks for any help,
     
    Okay, my first question is, why use java? I know that you only know this language, but why not learn more?

    If you have a basic knowledge of a programming language then picking up another is quite simple, you just need to know the syntax of it.
    The reason I say this is because you would need to program the whole game engine yourself before even starting on the game - why reinvent the wheel when there are game makers out that that do all you need?

    I am obviously just assuming that a Pokémon game is what you'd like to make considering you posted here, however correct me if I am wrong.

    But I'd suggest taking a look at Sphere or RMXP and see how how you like them. I personally use Sphere, and it's a very flexible engine that can pretty much do whatever you want it to do based on your knowledge. For example, the game I'm making, Pokémon Odyssey, has online play and trading, a character creation system and a few other less used features.

    I'm going to be writing up a big beginners tutorial using Sphere later on, so once it's done you may like to look at that and learn?

    However if you'd really like to create your own engine for your game, it's going to get somewhat complicated. I don't really know any Java so it's hard for me to explain to you.
     
    Games are hard

    It sounds like you're setting the co-ordinates of a component with the layout manager? If so, that might not work. I would instead go down to the low level image stuff. That way you have full control over positioning but you have to do all the co-ordinate logic yourself. Swing probably caches movement inside the interface so that nothing happens. You may have to pack() if you move things about? I don't know what you are doing without code.

    Games are hard. I'd start getting something basic to display on the screen, like a map. This map would allow a character to be anywhere on the map. You need to think of a way to represent the map and where the characters are.

    Then you can start writing a display engine. In my Java game for one assignment (a two dimensional turn based strategy game, like Red Alert but not real time) I used the BufferedImage class from the API library and used drawImage to draw to it.

    https://leepoint.net/notes-java/GUI-lowlevel/graphics/43buffimage.html

    Forgot to say, you would draw to the screen using your own swing JPanel class, when you override paintComponent method you are given the graphics to draw to. See the web page, it makes it a little clearer. Remember that you're working with pixels.

    Good luck man!
     
    Last edited:
    I'm actually working on a Space Invaders game in Java. If you wanted I could give you the source and try and teach you how to do things. You need to know OOP, static, threads, graphics, and IO though before you can really learn anything.

    Similar to Improfane, I am using BufferedImages and a Canvas to draw my images on.

    By the way, for movement don't ever move the x or y positions in the Listeners directly. Simply set booleans to true or false in the Pressed/Released and then call another void. Something like:

    The following code is just from some random assignment in my programming class.

    Spoiler:
     
    Last edited:
    Back
    Top