4.2.2
Hi everyone,
I read the “Coding the player” section on the 2D Dodge the Creeps tutorial the official manual provides, but unfortunately even after I followed the directions precisely on how to associate an action with a certain key, it still doesn’t work properly according to the keys I assigned (moving the mouse wheel left and right in more detail).
Can someone please explain to me why it doesn’t work correctly? Am I perhaps missing another detail, or using the wrong keys? Thank you all very much in advance.
Download Link for Game, in ZIP File
Nah, those left and right inputs in the demo had been broken for a while. I had a similar problem using a controller in this vid a long time ago.
Awesome help! Do you know what the correct solution is then?
To tell you the truth, I’m not sure exactly what problem you have with it. Are you trying to control everything with the mouse wheel? My current mouse wheel doesn’t even move left and right, so I can’t really test.
I am trying to detect when you move the mouse entirely left and not just the mouse wheel, the paddle should move left, and likewise when you move the whole mouse right and not just the mouse wheel right the paddle should move right as well.
Does that make sense what I want to do more exactly now?
That’s what you were trying? And what is the problem? Are the directions flipped? Does the paddle doesn’t move at all?
The paddle doesn’t move at all, so I would like to know what the appropriate conditions are for checking whether you move the entire mouse left or right, and not just the wheel as it obviously doesn’t work from the above discussion.
When I said the mouse wheel doesn’t work I meant that the actual mouse I’m using doesn’t have the capability physically to move the wheel left and right.
Which is fine, but I want to know how to move the entire mouse and not just the mouse wheel, and detect that motion in particular, just like how it works in a normal breakout game.
Just out of curiosity, are you trying to make the paddle follow the mouse position on screen. Or use the mouse like if you were swiping left and right on a phone screen?
I want it to follow the mouse position on the screen.
Anyway. I gtg. So I’ll just leave both here:
Mouse Cordinates
InputEventMouseMotion
Unfortunately, after I copy pasted the code given in the InputEventMouseMotion the paddle still doesn’t move at all.
I have updated the link, here is the new link:
Link to Updated Brick Breaker Game
I would make an educated guess that I am missing something extra, but have no clue what it is.