help... my actor doesn't collide enough

CLAYCLAY Member Posts: 72
edited November -1 in Working with GS (Mac)
Hello I'm having trouble with an issue :

my player must die in a level to pass the other… he must be killed by a fireball.

so what i did is this :

(actor-player-)
when collide with fireball
{destroy this actor}

(actor-fireball-)
when collide with the player
{spawn} (actor-explosion-) ...(animation of like 53 images so in 15 frame per second it's 3.6 sec)
{timer} after 3.6 second (X) run to completion
{change scene} = next scene
{destroy this actor}

(actor-explosion-)
{animate} 15 fps
_____________________________________

those are the rules and everything is going well exept that the ''scene'' won't change. what i did I
made several fireball which arrives one after another… and it worked but the level doesn't work that way ... it'll be way too esay , it have to be only one fireball... and i don't know how to do it so i need help guys ... please !

Comments

  • stanimationstanimation Member Posts: 406
    Sometimes when I get problems like this I try reducing assets to a minimum making things very simple. Then build on that.
  • jmp909jmp909 Member Posts: 73
    maybe set a game attribute like

    game.hasFireball (boolean)

    then

    (actor-fireball-)
    when collide with the player
    AND
    game.hasFireball = false
    THEN
    game.hasFireball = true

    that way only one fireball can span
  • CrazybreadmanCrazybreadman Member Posts: 674
    You need to separate 'destroy' from everything else and make sure it fires after your other rules. Otherwise it goes off first and your other attributes don't have time to fire. To do this just make a local attribute on the actor such as 'die' and have that in the same rule box as your change scene and all that. Then in a separate rule box have when die is true destroy actor. Oh and set a timer for destroy so that it only goes off after your animation has run it's course.
  • CLAYCLAY Member Posts: 72
    @stanimation: i dont seriously think that's gonna solve this problem ...
    @mp909: the problem is to change the scene after the animation is finished... it won't change ... only if i made several fireball that gonna collide one after another to the actor BUT if i do that the level will be easy ...
    @Crazybreadman: it's my actor who has to kill himself ...

    i'm gonna lauch a demo to show you guys give me like 10 min
  • CrazybreadmanCrazybreadman Member Posts: 674
    Yes I know. You have attributes together that shouldn't be together. You have the destroy attribute in the same rule box and it destroys the fireball before doing (or finishing) anything else you want it to do. So you need to separate it. Also I wouldn't put the change scene attribute in the fireball, I would put it in a 'control' actor that is invisible and unmovable. Then have a global attribute named 'dead' and when the fireball hits it changes 'dead' to true. Then when 'dead' is true, change scene to 'whatever' after 'x many' seconds. The main thing to focus on w/ game logic is order.
  • CLAYCLAY Member Posts: 72
    @Crazybreadman ohh i'll try what you said !!
Sign In or Register to comment.