This site requires JavaScript, please enable it in your browser!
Greenfoot back
RedPhoneBooth
RedPhoneBooth wrote ...

2012/4/21

Fancy Collision Detection

RedPhoneBooth RedPhoneBooth

2012/4/21

#
Hello, I was wondering if there was a way for me to have a solid object but that was only partly solid. Like having a tree where you cant get past if your in line with the trunk, but where you can if you above the trunk, but still walking through the leaves. just thinking about it would it be possible for me to have a class called 64x64_Object, and each subclass was solid in the defined 64x64 cell area, but not outside of it? or should I get the players x and y positions and compare them with a solid objects relative x and y positions that I want solid, and if the players x and y positions are within the solid x and y positions, stop movement (or something along those lines). which is the easiest way to go about this?
davmac davmac

2012/4/21

#
One way is to break the actor up into more than one object - eg. one for the trunk and one for the leaves. Only check for collision with the trunk.
RedPhoneBooth RedPhoneBooth

2012/4/22

#
yeah, I was considering doing that, but would that eventually lead to an unreasonable amount of actors? oh well, for my game I only really need the block one and then special ones like chests and bosses. Oh well, ill improvise
You need to login to post a reply.