I'm sorry to bother at my first post, but I have a strange problem (strange for me, at least).
My purpose is to make my character walk left/right by holding the left/right arrow key, so I used the IsKeyPressed script, as said in the Tutorial:
if (IsKeyPressed(372) == 1)
cEgo.Walk(cEgo.x, cEgo.y+3);
I changed the various parts that I had to change (keycode 377 instead of 372, the name of my character instead of cEgo, and I wrote x+6 and y instead of x and y+3). Then I tested the game: result? My character moves only as I RELEASE the right arrow, while normally animating. I tried to change the form using on_key_press, but it works the same. Now, tell me if something I did is wrong: I tried to write these lines in two sections (repeatedly_execute and on_key_press) of global.asc, wich one of them is the right one? Maybe both, maybe neither of them? Do I have to write them in the Room's scripting, or perhaps in the Global.ash? Did I use the wrong command?
I don't really know, I'm still too unexperienced.
I'll explain what happens in the game test once again, just to be shure that anyone comprehends:
I press the Right arrow key; the character's animation starts, while he moves one bit to the right, then he stays still on the place while the animation keeps running; as I release the key, the character moves to the right (supposedly by 6 pixels), then the animation ends, and the character stops moving.
Thanks in advance!
My purpose is to make my character walk left/right by holding the left/right arrow key, so I used the IsKeyPressed script, as said in the Tutorial:
if (IsKeyPressed(372) == 1)
cEgo.Walk(cEgo.x, cEgo.y+3);
I changed the various parts that I had to change (keycode 377 instead of 372, the name of my character instead of cEgo, and I wrote x+6 and y instead of x and y+3). Then I tested the game: result? My character moves only as I RELEASE the right arrow, while normally animating. I tried to change the form using on_key_press, but it works the same. Now, tell me if something I did is wrong: I tried to write these lines in two sections (repeatedly_execute and on_key_press) of global.asc, wich one of them is the right one? Maybe both, maybe neither of them? Do I have to write them in the Room's scripting, or perhaps in the Global.ash? Did I use the wrong command?
I don't really know, I'm still too unexperienced.
I'll explain what happens in the game test once again, just to be shure that anyone comprehends:
I press the Right arrow key; the character's animation starts, while he moves one bit to the right, then he stays still on the place while the animation keeps running; as I release the key, the character moves to the right (supposedly by 6 pixels), then the animation ends, and the character stops moving.
Thanks in advance!