I'm making a simple platformer where you play as a smiley face, jump onto a platform, then a moving cloud, which you use to get a key, which causes a cage covering the goal to raise. My problem is that you can pass through the cage. How do I make it so that my smiley does not pass through the cage. The cage is nothing advanced, something like this:
----------
| | | | |
----------
| | | | |
----------
| | | | |
----------
| | | | |
----------
Offline
Make some sprites for each boundary. A simple black line the length of a boundary would work. Code these boundaries to position them on the cage edges and hide them. With these in place you can have your character check for them, not pass them, etc.
Offline
TinkerZone wrote:
Make some sprites for each boundary. A simple black line the length of a boundary would work. Code these boundaries to position them on the cage edges and hide them. With these in place you can have your character check for them, not pass them, etc.
try making the sprite under the cage black and do, if touching color black if direction=right change x by -5 if direction=left change x by 5. that works really well but change the first if, (if touching color black) to forever if. Hope that helps! I will check it out when its done!
Offline
bigpboy wrote:
Thanks for the help. Instead of touching a color, I said touching a sprite, since I have a flagpole that's black. The game (very small; shouldn't need to be downloaded) will be up soon after this is.
I have found using object interactions is better than sensing colors. When you get this done, post a link please.
Good luck.
Offline