Moonwalk

Non-platform specific questions.

Moonwalk

Postby BlarghNRawr » Fri Sep 26, 2008 2:13 am

I need a code to eliminate moonwalking :D
no urgency
Last edited by BlarghNRawr on Wed Mar 18, 2009 4:35 pm, edited 1 time in total.
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby edh » Fri Sep 26, 2008 10:07 am

Did you look at Sgt Sparkys demo?
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sat Sep 27, 2008 12:30 am

cant download demos..
can u explain it to me?
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby jimmynewguy » Sat Sep 27, 2008 12:54 pm

depends (left and right? left up down right? left up down right + diagonals?)
which 1 do you need explained
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sat Sep 27, 2008 3:39 pm

just left and right :D
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby jimmynewguy » Sun Sep 28, 2008 3:01 am

all right
under draw actor put
Code: Select all
char *key=GetKeyState();

if (key[KEY_LEFT]==1&&key[KEY_RIGHT]==0)x-=5;
else if(key[KEY_LEFT]==0&&[KEY_RIGHT]==1)x+=5


then under keydown right
Code: Select all
char *key=GetKeyState();
if (key[KEY_LEFT]==0&&key[KEY_RIGHT]==1) ChangeAnimation("Event Actor", "walkr", FORWARD);
else if(key[KEY_LEFT]==1&&key[KEY_RIGHT]==1) ChangeAnimation("Event Actor", "standr", FORWARD);\

and
Code: Select all
char *key=GetKeyState();
if (key[KEY_LEFT]==1&&key[KEY_RIGHT]==0) ChangeAnimation("Event Actor", "walkl", FORWARD);
else if(key[KEY_LEFT]==1&&key[KEY_RIGHT]==1) ChangeAnimation("Event Actor", "standl", FORWARD);
for left down
than
Code: Select all
char *key=GetKeyState();
if (key[KEY_LEFT]==1&&key[KEY_RIGHT]==0) ChangeAnimation("Event Actor", "walkl", FORWARD);
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==0) ChangeAnimation("Event Actor", "standr", FORWARD);
for right up and finnally
Code: Select all
char *key=GetKeyState();
if (key[KEY_LEFT]==0&&key[KEY_RIGHT]==1) ChangeAnimation("Event Actor", "walkr", FORWARD);
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==0) ChangeAnimation("Event Actor", "standl", FORWARD);
for left up

i probably should explain it so.........here goes(gulp)
if bassically checks if key right is up or down and if key left is down or up and changes the animation and directional volocity accordingly just remeber to make sure all the "key ups" and "key downs" are NOT! have repeat disable
(i would tell you again but repeats off :lol: ) so there
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: MOOOOOOONwalk

Postby DilloDude » Sun Sep 28, 2008 4:46 am

You could check the method I used in my Samureye demo. That works pretty well.
In short, you subtract whether key_left is pressed from whether key_right is pressed. This means that if both are pressed, or none are pressed, the result is 0. If just right is pressed, it will be 1. If just left, then -1. If it is 0, you set some variable to say you are stopped. Otherwise, you set it to say you are moving, and set another variable to the value to say which direction you are moving in. Later on, you check these variables and move and change animations accordingly.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sun Sep 28, 2008 4:37 pm

thanx guys
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Fri Oct 03, 2008 12:53 am

@jimmynewguy:
so can i delete my lwft and right walking codes and just use this instead :?: :?: :?:

also, i just tried this and it sayes there are errors in the first code :(
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby jimmynewguy » Sat Oct 04, 2008 5:26 pm

oops misplace semi colin(;)
Code: Select all
char*key=GetKeyState();
if (key[KEY_LEFT]==1&&key[KEY_RIGHT]==0)x-=5;
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==1)x+=5;


there
and yes delete other walking scripts :D
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sat Oct 04, 2008 5:29 pm

i fixed the ; before, and it said there was a problem with line 1
cant covert char to * or something strange :|
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby jimmynewguy » Sat Oct 04, 2008 6:53 pm

ya i fixed that with
Code: Select all
char*key=GetKeyState();
if (key[KEY_LEFT]==1&&key[KEY_RIGHT]==0)x-=5;
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==1)x+=5;

this^
(key)
:lol:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sat Oct 04, 2008 7:35 pm

ok i try it :D
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: MOOOOOOONwalk

Postby BlarghNRawr » Sat Oct 18, 2008 2:07 am

actually the control is W.A.S.D. A is left, D is right, so would it be:
Code: Select all
char*key=GetKeyState();
if (key[KEY_A]==1&&key[KEY_D]==0)x-=5;
else if(key[KEY_A]==0&&key[KEY_D]==1)x+=5;
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Moonwalk

Postby BlarghNRawr » Wed Mar 18, 2009 4:41 pm

OK everything worked perfectly, however, there is another moonwalking problem if you hold down to crouch, and then start to move and release crouch, you will simply slide...
ive had this problem for a long time, im just too lazy to ask how to fix it...

here is the codes for left down (a), right down (d), draw actor, key up left (a), key up right (d), key down down (s) and key up down (s)


they are all screenshots tho =D
Attachments
Examples.zip
heh
(40.58 KiB) Downloaded 100 times
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron