I'm trying to make a mouse controlled maze type game where the Cursor actually bounces off the walls. I played a flash game like this a while back. Problem is, if I move the mouse even slightly fast, it will go right through the wall. I've tried Fastloop and still doesn't work as well as I would like. Is it hopeless? I'm using MMF2.
yep. It works a bit... i guess it just can't be detected when you move the mouse quickly... if someone could make a quick example of how to do it I would really appreciate it..
Well, you won't be able to do it by simply testing the mouse's position. You'll have to determine its speed, and from that do the appropriate collision tests.
wow thanks alot. It would be perfect if the object could like slide up the sides of the walls. Right now if you try to do that it is just sort of stuck in one place. But its still amazing thanks alot. If anyone can figure out a way to do the sliding thing and keep this engine you get 2 gold stars.
The chickens are coming...
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
14th September, 2007 at 12:27:26 -
Using a fastloop should work, as long as you "draw a line" between the old and the new position, and check every part in this path until it's at the end.
The linear formula in the bézier curve tutorial can help you finding the line and each seperate position.
I'll try it out but it sounds a little too complicated for me. Also, why can't I do a left-click event when I have a mouse controlled object. Is there a way around this? Later on, I want the object to shoot something every time you click. But unless I do repeat while clicking, it doesnt work.
Edited by the Author.
The chickens are coming...
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
14th September, 2007 at 15:15:14 -
An object with mouse movement uses "button 1" and "button 2" for mouse clicks.
EDIT: btw, what I was talking about before just tried to make sure it'll move one step closer to the mouse's new position, while still checking collisions and stuff. Get it to react inside the loop as soon as possible by stopping the loop when it's overlapping a wall, and do some other actions that would reverse the ball or whatever.