Jump to content
  • Advertisement

Archived

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

Maega

[java] Java 2D Tile Engine?

This topic is 5222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
http://j2da.sourceforge.net/
http://java.dnsalias.com/
http://www.scottshaver2000.com/template/template.php?page=planetation_main

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!