Skip to main content
gamedev.net
🔒 Locked

[java] Side Scroller

Started by BartG Nov 9, 2001 at 7:35 PM 7 replies 1.7k views
Original Post
BartG
BartG
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!
Chaoslab
Chaoslab
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....

:-)
ujhkfkfk
Scorpion
Scorpion
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.
GKW
GKW
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
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
GKW
GKW
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
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
javanerd
javanerd
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.
-Pasi Keranen
GoofProg
GoofProg
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.

The nightmare travels across the cosmos with his burning mane.  The trail of ash that is produced. ?Have a nice day!?
GKW
GKW
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
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.