Page 1 of 1

makin a new game and need lots of help

PostPosted: Tue Jun 24, 2008 2:04 pm
by deamonslayer4292
ok im startung off easy with anouther side scroller but this time i need my guy to hit the enemy with his sword to kill him instead of his body also i need to no how to change attack animations to the right if ur facing right and left if ur faceing left i could fix this by adding two attack buttons but i want to make it as simple as i can. i have made a background in ms pain but i dont know how to use it as a background i tryed makeing it an actor but it stays in front of my guy so it looks like a moving background i think that would be enough for awhil so if u guys could help thanks

Re: makin a new game and need lots of help

PostPosted: Wed Jun 25, 2008 10:26 am
by Spidy
how to change attack animations :
go to ADD=KeyDOWN=choose Attack button=ADD Action=Go to Script Editor
create two variables:
1=player_right
2=player_left

CODE:
if (player_right);
{
changeanimation(playerattackright)
}
if(player_left)
{
changeanimation(playerattackleft
}

Re: makin a new game and need lots of help

PostPosted: Wed Jun 25, 2008 2:15 pm
by DST
Then expand on spidy's code by putting it all in a case switch for jumping:

switch (canjump)
case 0: //if he's in the air
if (player_right);
{
changeanimation(playerjumpingattackright)
}
if(player_left)
{
changeanimation(playerjumpingattackleft
}
break;

case 1: //on the ground
if (player_right);
{
changeanimation(playerattackright)
}
if(player_left)
{
changeanimation(playerattackleft
}
break;
}

Re: makin a new game and need lots of help

PostPosted: Wed Jun 25, 2008 3:05 pm
by Bee-Ant
Oh,you remind me with Darkboy.
Well,make some actor variables : right,attack
Player keydown left
Code: Select all
right=0;
if(attack==0){
x-=3;}

Player keydown right
Code: Select all
right=1;
if(attack==0){
x+=3;}

Player keydown to attack
Code: Select all
if(attack==0){
if(right==0){
ChangeAnimation("Event Actor","AttackLeft",FORWARD);}
if(right==1){
ChangeAnimation("Event Actor","AttackRight",FOWARD);}attack=1;}

Player animation finish of AttackRight
Code: Select all
ChangeAnimation("Event Actor","StopRight",FORWARD);
attack=0;

Player animation finish of AttackLeft
Code: Select all
ChangeAnimation("Event Actor","StopLeft",FORWARD);
attack=0;

Enemy collision of player
Code: Select all
if(player.attack==1){
//hit action
}

Good luck :D

Re: makin a new game and need lots of help

PostPosted: Wed Jun 25, 2008 11:44 pm
by deamonslayer4292
thanks darkboy was what i was thinking of when i started

Re: makin a new game and need lots of help

PostPosted: Wed Jun 25, 2008 11:46 pm
by deamonslayer4292
only thing now is the background
any ideas?

Re: makin a new game and need lots of help

PostPosted: Sat Jun 28, 2008 5:24 am
by Spidy
deamonslayer4292 wrote:only thing now is the background
any ideas?


Add Actor=(choose name)
Add Animation=choose BG animation
Click on parent box change and choose view.Now your BG animation become Background :D

Re: makin a new game and need lots of help

PostPosted: Sun Jun 29, 2008 1:13 am
by deamonslayer4292
yes but my background keeps going in front of my guy

Re: makin a new game and need lots of help

PostPosted: Sun Jun 29, 2008 4:21 am
by DST

Re: makin a new game and need lots of help

PostPosted: Sun Jun 29, 2008 3:21 pm
by Spidy
deamonslayer4292 wrote:yes but my background keeps going in front of my guy


Change the zdepth of BG.check the pic

Re: makin a new game and need lots of help

PostPosted: Sun Jun 29, 2008 11:17 pm
by deamonslayer4292
hey tahnks i just started messing with the zdepth cuse i dident no wat it did lol thanks alot

Re: makin a new game and need lots of help

PostPosted: Mon Jun 30, 2008 5:41 am
by Spidy
no problem DUDE!!