943,662 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 3303
  • Java RSS
Aug 22nd, 2008
0

Re: java platform game

Expand Post »
oh no! i double posted the thread! how do i delete one? sorry
Last edited by esy928; Aug 22nd, 2008 at 3:06 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 22nd, 2008
0

java platform game

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
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 22nd, 2008
0

Re: java platform 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 @_@
Reputation Points: 392
Solved Threads: 108
Posting Shark
Alex Edwards is offline Offline
971 posts
since Jun 2008
Aug 22nd, 2008
0

Re: java platform game

oh.. ok, umm.. how do you create the level then? (im doing the game using only drawRect and other draw... methods)
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 22nd, 2008
1

Re: java platform game

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 --
Reputation Points: 392
Solved Threads: 108
Posting Shark
Alex Edwards is offline Offline
971 posts
since Jun 2008
Aug 22nd, 2008
0

Re: java platform game

noooo... im using simple methods, just shapes.. but ill check what GCanvases is =) thanks edwards!
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 22nd, 2008
0

Re: java platform game

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 =)
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 22nd, 2008
0

Re: java platform game

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.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Aug 22nd, 2008
0

Re: java platform game

oh.. ok! thanks ill google GCanvas NOW! =) thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Cannot Find File Exception
Next Thread in Java Forum Timeline: help i need to make a program that has a three equation and three unknown





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC