SPACE INVADERS MECHANICS

  • hello i am trying to make my own version of space invaders, but i have run into a bit of problem when trying to make a mechanic. Generally when the spaceship shoots the shield the shield also starts to break, so i am trying to make a mechanic where when the player gets the power up they become able to shoot through the shield without damaging it. I am not able to get the code to work properly so it would be a great help if i could get some insight as to how to proceed to make the game.

    Thank You

  • SOMETHING LIKE THIS:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would use different states for the weapon. IE: have a variable called "bulletType" or something, and "if bulletType=0" then the bullet is blocked, "if bulletType=1" the bullet passes through, "if bulletType=2" the bullet can destroy the shield, etc. This variable can be global, but I would attach it to the player sprite (or an invisible detector sprite if you use one).

    You'll have to code the different ways the bullet affects the shield for each setting.

    Example:

    if bulletType=0

    +bullet collides with shield

    --->destroy bullet

    if bulletType=1

    +bullet collides with shield

    --->(this might just remain blank, since it would pass through and not affect the shield, may want to use a comment so you'll remember why, keep the code in case you need it to perform other duties, or if this is all it is for, delete this section and comment why)

    if bulletType=2

    +bullet collides with shield

    ---> destroy bullet, destroy shield

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)