How would you make a 'attack' for my main character, that destroys other actors.
Like how would you make a gun? Or a sword that would be able to kill a 'monster'?
if (lastdirection ==1)
{
yvelocity-=15;
}
if (lastdirection ==2)
{
xvelocity-=15;
}
if (lastdirection ==3)
{
yvelocity+=15;
}
if (lastdirection ==4)
{
xvelocity+=15;
}
lastdirection=1;
lastdirection=2;
lastdirection=3;
lastdirection=4;
Zehper48 wrote:
- Code: Select all
if (lastdirection ==1)
{
yvelocity-=15;
}
if (lastdirection ==2)
{
xvelocity-=15;
}
if (lastdirection ==3)
{
yvelocity+=15;
}
if (lastdirection ==4)
{
xvelocity+=15;
}
switch (lastdirection)
{
case 1: yvelocity -= 15; break;
case 2: xvelocity -= 15; break;
case 3: yvelocity += 15; break;
case 4: xvelocity += 15; break;
}
Users browsing this forum: No registered users and 1 guest