[java] Java 2D Tile Engine?
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?
http://j2da.sourceforge.net/
http://java.dnsalias.com/
http://www.scottshaver2000.com/template/template.php?page=planetation_main
http://java.dnsalias.com/
http://www.scottshaver2000.com/template/template.php?page=planetation_main
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]
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]
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...
gotta go to sleep...
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.
+ 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.
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
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement