Skip to main content
gamedev.net
🔒 Locked

[java] Java 2D Tile Engine?

Started by Maega Feb 27, 2004 at 12:33 PM 6 replies 1.8k views
Original Post
Maega
Maega
Is there a good one out there? I haven''t been able to find one . If you guys know of one, could you link me please?
nonnus29
nonnus29
http://j2da.sourceforge.net/
http://java.dnsalias.com/
http://www.scottshaver2000.com/template/template.php?page=planetation_main
Jebediah
Jebediah
My tile engine

This isn't the best example, since it has a few bugs, mainly that it takes 100% of ur cpu. But that will be easily fixed later. Figured it mite help because it is much more basic then the other examples out there.

Main class
Character class
Map class

Nostalgic Studios - http://www.freewebs.com/nostalgicstudios/
Email: Jebb99@Excite.com


[edited by - Jebediah on February 28, 2004 9:23:13 PM]
hewhay
hewhay
Jebediah, I have being looking at your code and i can''t see how do you check if the player can step on a tile, it could be that its 4:24 ind the morning thought ...


gotta go to sleep...
humanity will always be slaved by its ignorance
Jebediah
Jebediah
if (map[screenWidth / 2
+ player.x
+ player.xOff
+ 1][screenHeight / 2
+ player.y
+ player.yOff
+ 1].Type
< 0) {
player.x = oldX;
player.y = oldY;
player.xOff = oldXOff;
player.yOff = oldYOff;
}

This little bit of code is in KeyPressed. The first thing it does is store the past positions. Then it moves the player accordingly. If the new position is a collision, then move the player back to old position.

There are better ways to do it, but it works. What I should do is comment my source more, especially if I''m going around sharing my source. Sorry ''bout that.
hewhay
hewhay
i''m making my own tile engine for an mmorpg(i know...) do you think we could cooperate?
humanity will always be slaved by its ignorance
Jebediah
Jebediah
MSN- Jebediah05@hotmail.com

MMORPG? How do you plan to get the MM part done? At any rate I am currently working with another java programmer. We could definitly cooperate, maybe even work on the same rpg. Talk to me on msn.

BTW - I have very little time to program during school, I do most of my programming during summer.

Nostalgic Studios - http://www.freewebs.com/nostalgicstudios/
Email: Jebb99@Excite.com
paulecoyote
paulecoyote
You need this book: Developing Games in Java
David Brackeen, Laurence Vanhelsuwé

http://www.amazon.co.uk/exec/obidos/ASIN/1592730051/qid=1078158208/sr=2-1/ref=sr_2_11_1/202-3486186-4223843

It''s GREAT - and has all that tile engine stuff in the first few chapters - BEFORE going into how to create your own low-level 3d engine.

Can''t recommend it enough.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.

Topic Locked

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

Sign in to reply to this topic.