0 Favourites

How do I make enemies absorb then explode?

  • I wanna have it so when enemy is hit by lasers they absorb it and if killed with lasers when they explode they release a bullet pattern but if killed by missiles then no bullet pattern. For the other enemy if they are killed with missiles then no bullet pattern. No absorb needed for this enemy. Thanks everyone

  • Sounds like a variable would work. When hit by a laser have the variable tick up one. Like self.absorb +1 and then when a laser destroys it right before the destroy event have it spawn a bullet maybe with a repeat equal to .absorb. So if absorb is at 6 then repeat create bullet 6 times and then figure out how your going to handle angles.

    so to recap I would handle it like

    local variable "absorb"

    when hit by laser add 1 to absorb

    when destroyed system - create object- bullet (repeat "absorb" times)

  • heromedel ok i'll try that. Do you know how I can absorb for players special move bar? For example you know in most shoot em up games there's an energy bar that builds up when killing certain enemies or whatever and when it's full you can unleash a super move? I wanna do that also.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Again 'Variables" are the answer

    Make one called "specialPower" (call it anything you like)

    Then for every enemy or special enemy killed add value to that variable.

    Example

    enemySpecial destroyed ...add 10 to specialPower.

    then have condition that is true only when the value of the variable specialPower is a pre decided one .

    Example

    if specialPower>=100 then.....special move "kaboom" is active

    Im sure there are many ways to approach this but this is pretty straight forward.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,513
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,837
minhcuong's avatar
minhcuong
Unread hot topic
99 10,152
karshinkoff's avatar
karshinkoff