Jump to content


Collision and pressing keys repeatedly

  • Please log in to reply
No replies to this topic

#1 itsnima24


    GMC Member

  • GMC Member
  • 13 posts
  • Version:GM8

Posted 02 December 2012 - 08:40 AM

Hello!. i am having a problem with collision. When my character (mouse) collides with the cheese, the player has to press A and D repeatedly to make it disappear. (the sprite changes gradually until it disappears) However, when the mouse collides with the cheese and you press A, the cheese doesn't change, but if i move the mouse with the Up arrow key while colliding with the cheese and then press A, that is when the cheese changes. D: I'm confused.

This is the code I used in the Step event for the mouse
if collision_rectangle(x,y,166,192,obj_cheese_full,1,0)&& keyboard_check(ord("A"))

My code for Collision with obj_cheese_full
if keyboard_check(ord("A")) { 

And here is the code for the Keyboard A event
if collision_rectangle(x,y,166,192,obj_cheese_full,1,0)&& alarm[0]=-1 {

Am I on the right track? Do you have any codes that would help?
Please help. D:
Thank you!

Edited by itsnima24, 03 December 2012 - 04:38 AM.

  • 0