rotating player

Game Editor comments and discussion.

rotating player

Postby mr-game » Sun Apr 22, 2007 8:04 pm

how do u rotate the player on a key down event eg
if you press the right arrow key he starts to rotate right and same for left
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Postby pixelpoop » Sun Apr 22, 2007 8:19 pm

User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby mr-game » Sun Apr 22, 2007 8:21 pm

yea well i read that before and i didnt get it at all so can anyone put it into words i cant undertsand
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Postby Sgt. Sparky » Sun Apr 22, 2007 10:05 pm

make the pre-rotated images and have them all in one animation,
make sure it is rotating starting with the player pointing right,
make it rotate all around(right to left) to the right again. :)
and lets say you pressed the left key(repeate enabled): animpos += 1;
and for the key down event of right(also repeat enabled):animpos += 1;
and for the draw actor event use,
Code: Select all
if(animpos > nframes)animpos = 0;
if(animpos < 0)animpos = nframes;

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

oh and dont..

Postby kyensoftware » Tue Apr 24, 2007 12:00 pm

Oh...and dont have a group of images (image1, image2, etc.) because it will glitch and flick to the middle frame and back all the time...make a 1 file gif with UnFREEZ (google is like a bible!!:wink: )
When u use UnFREEZ put the delay to 0cs, or else it looks like crap!
User avatar
kyensoftware
 
Posts: 198
Joined: Thu Oct 26, 2006 7:49 am
Score: 5 Give a positive score

Postby Sgt. Sparky » Tue Apr 24, 2007 4:20 pm

I do not think that a delay time would make it look like poo. xD
that would require a few big changes! xD :lol:
I know what ya' mean. :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby FiLLLe1 » Sat May 26, 2007 5:38 pm

Sgt. Sparky wrote:make the pre-rotated images and have them all in one animation,
make sure it is rotating starting with the player pointing right,
make it rotate all around(right to left) to the right again. :)
and lets say you pressed the left key(repeate enabled): animpos += 1;
and for the key down event of right(also repeat enabled):animpos += 1;
and for the draw actor event use,
Code: Select all
if(animpos > nframes)animpos = 0;
if(animpos < 0)animpos = nframes;

:D


Hi! I've tried this to my game to, but not i'm not getting it to work :/ .
This is what i've done:
- I've made 36 animations of my actor.
- I choose the option "Mulitple files" in the add animation area. (I made one gif animated rotation file to and tested.)
- The actor starts with the rotate at the right, and goes around to the right again.

So when i press "key up" i used the script you posted above and then the script for key down. But I don't know if i've understod it all wrong cuz it doesent rotate correctly. When i press key down, it rotates down. When i press key up, it just stops.

Plz help :) // Fille
FiLLLe1
 
Posts: 16
Joined: Mon Feb 26, 2007 10:05 pm
Score: 1 Give a positive score

Postby Sgt. Sparky » Sun May 27, 2007 1:43 am

I forgot for the right key
animpos -= 1;
but you can just use change animation direction forward or change animation backwards. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby FiLLLe1 » Sun May 27, 2007 8:52 am

ok thx for answer :D but i'm still not getting it to work. It's something i've done terribly wrong. Ok, without scripts, the animation is rotating. Should it do that? Now when i press up and down it rotates that way but if the animation has rotated 180 degrees and i press up the animation just jump 180 degrees back to start position. And it never stops rotating.

Srry for many questions i'm not good at all on GE ;)

//Fille
FiLLLe1
 
Posts: 16
Joined: Mon Feb 26, 2007 10:05 pm
Score: 1 Give a positive score

Postby DilloDude » Sun May 27, 2007 10:12 am

You first need to stop the animation. On the create actor event, add a ChangeAnimationDirection("Event Actor", STOPPED) event. To rotate clockwise, use the script: animpos ++; and to rotate counter-clockwise, use the script: animpos --;
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby FiLLLe1 » Sun May 27, 2007 10:47 am

thanx :D it works!
FiLLLe1
 
Posts: 16
Joined: Mon Feb 26, 2007 10:05 pm
Score: 1 Give a positive score

Postby Sgt. Sparky » Tue May 29, 2007 3:59 pm

Yay! :D
(you do not need animpos++ or animpos --, just do what he said and change the animation direction to stopped when it is created, and when you release the left arrow key or right change the animation direction to stopped(on key up) and with the left key pressed, forwards animation direction, right key = backwards animation direction. :D)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron