Mouse problems

Posted by RetroVortex on Sept. 25, 2006, 1:29 p.m.

Hello, I'm having some troubles with the mouse.

Basically I'm making a game where you hit the ball and it will bounce from the angle of the 'bat'. The angle of the 'bat' is determined by the mouse_x, however it will work with slow mouse movemnts but when you move the mouse fast, the ball moves through the 'bat' as if it hadn't collided with it. Is this a bug with GM, or can you think of a solution to this problem. I would release the GM6, but I don't want to spoil this experimental project as I don't want this idea copied..

Please help!

Comments

smaksak 19 years ago

you can solve this in a few ways, one is to make the room speed faster.

another way is to use this code for collisions instead of the usual collision event

if collision_line(x,y,xprevious,yprevious,nameofobjecttocollisionwith,true,true)
{
    //Your
    //Code
    //Here
}

good luck

RetroVortex 19 years ago

That could work..

But I'll try it tomorrow..

too busy reading uncyclopedia articles…

Polystyrene Man 19 years ago

The reason this is happening is because either the ball or paddle is going too fast. Game Maker redraws the screen every step, and if your paddle is moving at an hspeed of 10 (10 pixels per step), that means it will completely skip over 10 pixels. If your ball happens to be within that blank space, it will not collide.

Do what smaksak said and you should be fine.

chicklet 19 years ago

we meet again…

RetroVortex 19 years ago

Nooooo!!!!

Just kidding!

chicklet 19 years ago

its only me second semester of college…

i still have like…

five years:(

…..

when do you gaduate?:)