java platform game

Thread Solved
Reply

Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

Re: java platform game

 
0
  #1
Aug 22nd, 2008
oh no! i double posted the thread! how do i delete one? sorry
Last edited by esy928; Aug 22nd, 2008 at 3:06 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

java platform game

 
0
  #2
Aug 22nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: java platform game

 
0
  #3
Aug 22nd, 2008
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 @_@
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

Re: java platform game

 
0
  #4
Aug 22nd, 2008
oh.. ok, umm.. how do you create the level then? (im doing the game using only drawRect and other draw... methods)
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: java platform game

 
1
  #5
Aug 22nd, 2008
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 --
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

Re: java platform game

 
0
  #6
Aug 22nd, 2008
noooo... im using simple methods, just shapes.. but ill check what GCanvases is =) thanks edwards!
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

Re: java platform game

 
0
  #7
Aug 22nd, 2008
im not really good in java, i just started 3 months ago, so im not that familiar with some of the classes in java. i was going to use JPanel and the draw methods to create my side scrolling game, but im not making any progress. cant seem to get the logic of how to create and display the levels =)
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 762
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: java platform game

 
0
  #8
Aug 22nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 36
Reputation: esy928 is an unknown quantity at this point 
Solved Threads: 0
esy928 esy928 is offline Offline
Light Poster

Re: java platform game

 
0
  #9
Aug 22nd, 2008
oh.. ok! thanks ill google GCanvas NOW! =) thanks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC