Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (687)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Need platform game tutorial or working code example  (Read 2896 times)
0 Members and 1 Guest are viewing this topic.
Offline plastygrove

Junior Devvie

Medals: 1
Projects: 2

« Posted 2012-10-07 10:50:11 »

I'm new to game dev and just completed the SlickOut and SlickBlocks tutorials by Spiegel. I'd like to understand about Platformers viz, side-scrolling, mario/sonic style games. Any leads to working code examples or tutorials would be great.
Offline Tjstretchalot

Junior Devvie

Medals: 2
Projects: 1

« Reply #1 - Posted 2012-10-09 18:28:00 »

Wow, thats not exactly specific... at all.  I am assuming you are using Slick2D (based on the tutorial names you mentioned), so this is what I have used and wish someone told me when I started.

You don't need any direct OpenGL calls, if you do use a different library.
Animation class works just like the image class and can be replaced later.  Use the Animation class 99% of the time unless you are certain you won't ever need to add an animation - the performance cost on a side-scroller is negligible.

Running a platform, use velocities, don't bother with fancy timers for jumps, because you will replace it later.  Here's an example of what it might look like in the update method. For the full sourcecode of my platformer that you can play around with, look at This includes some basic AI, although extremely basic. [I used an AStar algorithm, ironically, for my pacman game.]

If your IDE supports it, make the background for hard-coded number REALLY UGLY. EG In eclipse Window -> Preferences -> Java -> Editor -> Syntax Coloring -> Numbers -> Red + Underlined + Italics. You should only see this color in constant static fields.

Besides those tips, don't get frustrated and avoid restarting.  And don't try to make it multiplayer until you are certain you have singleplayer games down and have competed in a few 48 hour competitions (these will really push your game understanding)

Offline plastygrove

Junior Devvie

Medals: 1
Projects: 2

« Reply #2 - Posted 2012-10-10 05:05:29 »

Thanks so much for the reply. Apologies if I wasn't specific. Yes, I'm looking for tutorials using Slick 2D, but will also be okay if it's general high level guidelines - like how to get the scrolling background with animated clouds and trees etc, implementing the jump, firing bullets, climbing mountains etc. And yes, I'm very new to this, so I'm not sure what Jump timer means. And at the moment, I'm not even going near LWJGL or direct opengl calls but sticking to slick2D. The animation class is a god-send for me Cheesy.

Thanks for sharing your source code. It has a lot of things I'm looking for, I'll go through it.

48 hr game contests sound scary. I don't think I've reached that point yet, still have to constantly switch back to example code to get a bearing.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (72 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (76 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (110 views)
2015-10-18 23:29:12

DarkCart (135 views)
2015-10-16 00:58:11

KaiHH (117 views)
2015-10-11 14:10:14

KaiHH (156 views)
2015-10-11 13:26:18

BurntPizza (172 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!