PLEASE...... someone help me:
Enemy:
- Random Movement (with timing punch, timing jump)
- Move to Player when touch the screen (without flying)
- Change Animation when move left, right
Jagmaster wrote:Take a look at Bee-ant's "Fighting demo, Ize"
if(yvelocity>=5)
{
P2Canjump=0;
}
if (yvelocity<14)
{
yvelocity+=gravity*2;
}
//------------------------------------------------------------------->
if(Player_State==1)
{
if(x<=player.x-15)//-----------------------Stand------->
{
P2dir=1;
}
if(x>=player.x+15)
{
P2dir=-1;
}
if(x<=player.x-50)//--------------------------Walk------->
{
P2dir=2; x+=speed
}
if(x>=player.x+50)
{
P2dir=-2; x-=speed;
}
if(player.y<y-100&&P2Canjump==1)
{
yvelocity-=jump;
P2Canjump=0;
if(P2dir==2||P2dir==1)
{
xvelocity=speed;
}
if(P2dir==-2||P2dir==-1)
{
xvelocity=-speed;
}
}
}
xvelocity = xvelocity - 1;
xvelocity = -4;
xvelocity = 4;
Jagmaster wrote:Alright, if you want to do it with timers,
on your timer, you have :
- Code: Select all
xvelocity = xvelocity - 1;
instead:
- Code: Select all
xvelocity = -4;
replace 4 with your speed.
on right timer:
- Code: Select all
xvelocity = 4;
ehp= ?number
if(ehp==0)
{
//blah
}
ehp= whatever
if(ehp==0)
{
//die
}
x+=dir*4;
Users browsing this forum: No registered users and 1 guest