Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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 2119 times)
0 Members and 1 Guest are viewing this topic.
Offline plastygrove

Junior Member


Medals: 1
Projects: 2



« Posted 2012-10-07 12: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 Member


Medals: 2
Projects: 1



« Reply #1 - Posted 2012-10-09 20: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 http://www.java-gaming.org/topics/2d-shooter-difficulty/27419/view.html. 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 Member


Medals: 1
Projects: 2



« Reply #2 - Posted 2012-10-10 07: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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (37 views)
2014-07-18 06:55:21

Zero Volt (35 views)
2014-07-17 23:47:54

danieldean (28 views)
2014-07-17 23:41:23

MustardPeter (31 views)
2014-07-16 23:30:00

Cero (46 views)
2014-07-16 00:42:17

Riven (47 views)
2014-07-14 18:02:53

OpenGLShaders (36 views)
2014-07-14 16:23:47

Riven (36 views)
2014-07-14 11:51:35

quew8 (32 views)
2014-07-13 13:57:52

SHC (69 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!