Archived

This topic is now archived and is closed to further replies.

BartG

[java] Side Scroller

Recommended Posts

BartG    122
Can anyone give me a slight idea of how to create a Side scrolling engine in Java? I don''t want pure code, just some Pseudo code to give me an idea of how to do it because I''m stumped..Thanks!

Share this post


Link to post
Share on other sites
Chaoslab    116
I''d suggest you redraw the entire screen each up date that way you can scroll anyway you like! It''s easier in the long run since you don''t need to worry about restoring the background after sprite draws and you can animate stuff....

:-)

Share this post


Link to post
Share on other sites
Scorpion    137
you can do it like you do it in any other game. you can put the image that is drawn to the screen in an int-array, and handle the pixels in this buffer. then flush it to the screen when your done.

www.2dgame.nl check that site, it has some tutorials on 2d scroll games.

Share this post


Link to post
Share on other sites
GKW    200
Check out this link to a side scroller made by a Sun engineer working on their game profile. It is supposed to demonstrate the capabilities of the jdk 1.4 volatile image class.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
what a horrible example of a java program. So disorganized, doesn''t run. I pray to god that guy does not work at Sun.

Share this post


Link to post
Share on other sites
GKW    200
He did it as a technology demonstrator, not a game. He does work at Sun. He wrote a co-authored a book, "Java Platform Performance: Stratagies and Tactics". What have you done?

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
javanerd    122
I''ve got to say that I agree with Anon poster. The Scroller example is quite difficult to read as it uses inheritance based code reuse and other tricks that are difficult to follow when trying to read the code as its supposed to be executed.

Jeff (the programmer) is still the best source of info on JDK 1.4 fullscreen support. It is just shame that he usually answers different question than you asked and his code examples don''t really help either. But I''m not giving up yet. I''m quite determined to find out how you can create 1-bit alpha VolatileImages if you can at all.

GKW :"He wrote a co-authored a book, Java Platform Performance: Stratagies and Tactics. What have you done?"
I haven''t read Jeff''s book so I can''t judge it, but I don''t count everyone who writes a book as immediately enlightened person. I''ve read around 12 books on Java programming and most of them have been quite disappointing. Most often I''ve had the feeling I knew more on the subject than the guy who wrote the book.

Share this post


Link to post
Share on other sites
GoofProg    127
I have not been introducted to java, but the concept it easy.

You have a world of tiles .. let''s say 30 x 120 tiles for the theoritical game world.

You then contruct a viewing window of ..lets say 30x30 and then increase the location of the viewing window by x+1 tilesfor a rough scroll or by pixels for a smooth scrolling technique. You just clip off the tiles that are not shown at the time.

This is all I know
Good Luck.

Share this post


Link to post
Share on other sites
GKW    200
I think the guy is very knowledgeable, and as far as java books go it is alright. I can''t say that I have read an excellent java book so alright is pretty good in my book. I think it may just be a case of someone with a great deal of knowledge of java/jkd1.4 and the rest of us who don''t have the access and experience that he has with the new technology. I may sound a little harsh but I don''t think the gerbil should criticize if he can''t even get the demo to work. He doesn''t even know how well it works or not.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites