PDA

Click to See Complete Forum and Search --> : Damn, more problems. I got collision detection to work fairly well on ONE object, but


Apollo
Nov 13th, 1999, 08:15 AM
Can one of you, tell me the complete way to keep one image from entering another? Like in Zelda 1, where you can't walk into trees, or bricks. But you can walk anywhere on the floor you'd like.

Let's say you have two objects of equal size, and one moves at the speed of 20 increments per keypress. You don't want object 1 to enter object 2. How would you stop this?

Please tell me the full code, or as much as you know.

That is all.

------------------
"I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

SteveCRM
Nov 13th, 1999, 09:29 AM
Personally, I use timers to move. I say:
If keycode = vbkeyup then timer1.enabled = True...and I do the same in keyup just the timer is disabled. I do this because, you have smoother animation, and if a collition is detected, The timer for that direction is disabled. If this confused you in any way, please e-mail me, and I will send you a bit of code showing what I mean.

Steve (SteveCRM@aol.com)

[This message has been edited by SteveCRM (edited 11-13-1999).]