Help Creating Lightning Zapper Enemy Logic

Discussion in 'How Can I...?' started by jerry, Jun 19, 2018.

  1. jerry

    jerry Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    421
    Likes Received:
    232
    Ok, I need help with my Trixel Rocket game. I want to create a lightning/zapper enemy.
    1. Lightning needs to animate (animation done)
    2. I want it to be on and then off so that you can pass through it on off state.

    Screen Shot 2018-06-18 at 9.34.29 AM.png
    I've tried to make this an enemy that is a spawner and have it move slightly to one side where there is a transparent platform that destroys the zapper. That part works but then it destroys the platform. I can make the platform a spawner as well but timing is an issue of spawning the platform and the enemy same timing and there not being artifacts left when timing is off.

    Again, just want this to be an on and off on a set interval. Would be ok if I could animate the shape along with it's collision shape but you can't animate collision shape.

    ...or thought about making this an enemy bullet that is just slow (timed with animation as a decoration on top)

    ...or ???

    I keep putting this aside and working on other things while I think about it but thought it would be good to get some feedback.

    Don't know why I am struggling with this one.

    @ZackGriset @Christoph @Andy @AndyG
     
  2. Lamora

    Lamora Avid Boxer

    Joined:
    Dec 8, 2016
    Messages:
    282
    Likes Received:
    140
    You can make it like this:

    You need two Transofm logic attached to some object that will rotate in desire time

    In transform logic you have position so
    Affecting asset: Your Enemy
    One Transofm logic that will make laser disappear: set it some position value so it out of the game play area
    Second Tranform logic that will which will touch the laser in the position in which you move it and this will bring it back to the orignal position
     
    jerry likes this.
  3. stevinz

    stevinz Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    142
    I have done a timed pulsing laser before as well. Usually have the laser spawn as destroy character, health 1, damage 1, interval like 4 and permanent. Then spawn another permanent invisible object set to destroy enemy, health 1, damage 1, same time interval, like 50 or 100 pixels away. Have the invisible object set with a linear velocity that it takes a couple seconds to reach the laser. Then they both kill each other and disappear.
     
    jerry likes this.
  4. jerry

    jerry Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    421
    Likes Received:
    232
    Thanks @Lamora and @stevinz. Stevinz I tried that first. I think the problem is that I was planning on the laser rotating. I didn't even think of the transform logic idea. Trying to think of a million things at once... level ideas, marketing, gameplay, user engagement, trying to attract a fan base with social prior to launch, wife sick, kids fighting each other since not in school for the summer..... haha.

    Will get this game there and hopefully it will be something REALLY worth playing!!!

    Definitely appreciate the help for sure!! o_O
     
  5. moein

    moein Boxer

    Joined:
    Aug 14, 2018
    Messages:
    8
    Likes Received:
    2
    Thanks guy, it helps a lot
     

Share This Page