Page 1 of 1

goomba help

PostPosted: Sat Sep 25, 2010 4:27 am
by Waluigiftw
HELP
im having some trouble with my goombas
whenever the original mario landed on top of a goomba he would bounce up,the goomba would be flat and mario would escape unscathed.
however in my game im using a health aspect and my character will lose health upon collision with right or left side of goomba
whenever my character collides with a goomba even when its directly above it he still takes damage and sometimes the goomba doesnt even die! :evil:
*same thing for koopa*
yvelocity = yvelocity - 4;
*thats all i have in the player collide -> topside of actor gooba repeat yes*

CreateTimer("Event Actor", "goomba_die", 3000);
points.textNumber = points.textNumber +10;
ChangeAnimation("Event Actor", "goombaflat", FORWARD);
change_dir = 2;
*thats what i have in the goomba collide with bottom side of player repeat no*

and heres a picture of my goomba(if it helps)

Re: goomba help

PostPosted: Sat Sep 25, 2010 7:49 am
by zxcvbnm
No problem , I made a super mario demo for you .
Controls
left arrow=move left
rigth arrow=move right
space bar= mario jump

Ok when you stomp on goomba head , you bounce off and goomba dies.

Re: goomba help

PostPosted: Sat Sep 25, 2010 12:27 pm
by Bee-Ant
Goomba -> Collision -> Bottom side of Mario :

1. If you have "canjump" variable as Actor variable
Code: Select all
if(collide.canjump==0) //Mario is jumping
{
    //Kill the Goomba here
}

2. If you have "canjump" variable as Global variable
Code: Select all
if(canjump==0) //Mario is jumping
{
    //Kill the Goomba here
}


Then fix your code on Mario -> Collision -> Left or Right side of Goomba to:
Code: Select all
if(canjump==1) //Mario is landing
{
    //Decrease Mario health here
}

Re: goomba help

PostPosted: Sat Sep 25, 2010 1:30 pm
by SuperSonic
You could try making a "filled region" actor, making it the same size as your gooma, set the goomba as the parent of the filled region, then change the collision event.
Look at the attachement to see what I mean

Re: goomba help

PostPosted: Sat Sep 25, 2010 11:40 pm
by Waluigiftw
ok thanks everyone its working now :mrgreen: :mrgreen: :mrgreen: :mrgreen:
everyone input helped(i kinda used a combo of all of them :D

Re: goomba help

PostPosted: Sat Sep 25, 2010 11:43 pm
by zxcvbnm
I havent tryed the code yet but if that works bee-ant , your a genius!!!

Re: goomba help

PostPosted: Sun Sep 26, 2010 6:34 pm
by savvy
you could even use on the goomba:
Code: Select all
if(collide.y<y-height/2)
{
change to death
yvelocity=-8;
}
else
{
hp-=bleh;
}

that could help too