| | |
java platform game
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 36
Reputation:
Solved Threads: 0
hello guys!
i was just wondering, how do java game programmers create the map of platform games? (like mario , contra and other games like that) do they draw the whole map and show only a part of it? or draw them as the player approaches? or do they use another process? thanks!!!
I'm asking this because I have a project in which I need to create a side scrolling game
i was just wondering, how do java game programmers create the map of platform games? (like mario , contra and other games like that) do they draw the whole map and show only a part of it? or draw them as the player approaches? or do they use another process? thanks!!!
I'm asking this because I have a project in which I need to create a side scrolling game
Although I haven't attempted it before, I'd assume you'd have a particular zone renderred on the screen with a type of "cover" over it. Either that or only render certain pixels ahead of the borders on a pane.
The position of your character would, obviously determine when the screen will be renderred on the side...
Bah this has given me some ambition to make a game like this @_@
The position of your character would, obviously determine when the screen will be renderred on the side...
Bah this has given me some ambition to make a game like this @_@
I suppose you're using a GCanvas, or most likely the GraphicsProgram from the acm.program package?
You could have GCanvases pre-painted with components and when you advance a level, simply set the contentpane to a particular GCanvas of interest.
I think it may be better for me to produce an example, but that might take a bit of time --
You could have GCanvases pre-painted with components and when you advance a level, simply set the contentpane to a particular GCanvas of interest.
I think it may be better for me to produce an example, but that might take a bit of time --
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
Platform games are generally tile-based. So use a 2D array to store your map tiles. You only draw the tiles that are visible within the viewport (what the play can see on the screen). You'd basically have a map pointer that keeps track of what position in the map data it should start drawing. Using different layers (different Z-depth) you can create parallax scrolling backgrounds.
Don't use JPanel for drawing all these graphics. I never heard of GCanvas (i haven't done games in java) but if its designed for drawing graphics and game sprites, then it'll probably already be setup for double buffering.
Don't use JPanel for drawing all these graphics. I never heard of GCanvas (i haven't done games in java) but if its designed for drawing graphics and game sprites, then it'll probably already be setup for double buffering.
![]() |
Similar Threads
- Starting "Java" [Java tutorials / resources / faq] (Java)
- Game Engine (Game Development)
- Online Game (Game Development)
- team looking for project (Post your Resume)
- Another Java Noob :( (Java)
- adding an image to a java code (Java)
- Hijackthis report, I just don't know (Viruses, Spyware and other Nasties)
- Java open internet browser (Java)
- Game crashes while playing any game. (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Cannot Find File Exception
- Next Thread: help i need to make a program that has a three equation and three unknown
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows





