Jump to content
  • Advertisement
Sign in to follow this  

2D Collision

This topic is 3080 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

I am planning a 2.5D sidescroller in java that uses 3D models. Since thier are generally only 2 dimensions at a given time i've decided to take hold of java's awt library and use rectangle collision. So far I have gotten the models to correctly fall onto the floor however i seem to be having issues when they fall on top of each other. I created a hashmap with the characters spatials as keys and the awt rectangle as the entry.

Are their any suggestions on what should actually happen when a character lands ontop of another i was thinking they would slide off but everything i have tried until now have caused issues

for(int x=0; x<updateSpeed;x++){
for(Spatial s: models.keySet()){
boolean onGround = true;
for(Spatial p: platforms.keySet()){
for(Spatial s2: models.keySet()){
System.out.println("something should happen when two characters bump");

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!