Space Shooter extension

I am new to Unity and would like some help to further develop my understanding of how to program a shmups.

I have followed and completed the tutorial for Space shooter on Unity website and would like to make my own extension to it:

  1. I would like to add power ups
    1a. Double laser (timed)
    1b. Shield (timed)
    1c. Health pack (timed)

  2. I would like count the waves (infinite loop) and increase the difficulty as the player progresses the game (enemy speed and quantity)

  3. After a certain amount of waves the player will endure a boss fight. A new scene with one boss firing and taking hits - Simulating end of level.

3a. I have found a camera shake script to try on the boss scene.

Please can some kindly advise now to turn the pseudo into scripts?

I struggle to convert pseudo into logic worthy of a script.

Any help is greatly appreciated

Mutation

Pick one and do it first!

The double laser should be pretty straight forward. The space shooter tutorial has Hazards you can run into and get destroyed by, which gives you the basis for picking up pickups.

To shoot a double laser, do the same thing as for shooting a single laser, just twice! The single laser uses a “shotSpawn” to position the laser, so you can have two shots spawns and use those instead.

The order to progress in could be:
1: make the ship fire double shots (always)
2: make the ship fire single or double shots based on a bool that you can set in the inspector
3: make a pickup that turns that bool true when you run into it
4: make the bool turn back to false after some time.

Good luck! Feel free to ask follow up questions.

Hi and thank you for the information.

I have managed to get Unity to spawn new items (PowerUp and Health) sprites.
The sprites can be collected by the player ship, however the sprites can collide with enemy and destroy them and also absorb the bullets from the enemy.

Any help in this area would be greatly appreciated then I will need to look at how to instantiate two bullets from spaceship with a timer.

Mutation

2944550--218004--Screen Shot 2017-02-02 at 13.37.09.png

Hey there. To avoid collisions between objects that should not collide with each other use layers system.

Go to Edit → Project Settings → Tags and Layers and open Layers tab (Not Sorting Layers)

There You can add new layers like “Enemies”, “PowerUps”, “EnemyBullets” etc.

Then go to Edit → Project Settings → Physics2D

There at the bottom You will see tab called “Layer Collision Matrix”. You can tick and untick layers that can interact with one another. So if You have two layers “PlayerBullets” and “Enemies” You would like to have a tick there. But You do not want to have a tick at “EnemyBullets” and “Enemies”.

After that You can just give Your prefabs and objects correct layer so they ignore collisions according to collision matrix. You set a layer at the top of inspector when You selected Your game object (dropdown menu next to the tag dropdown).

1 Like

Using the shooter tutorial where would be the best place to use an independent Power Up array the gameController or playerController?

I suggest that anything that is game state related should be in one place. Like for example GameController. It should control what is going on when it is not related to for example enemy movement, player movement, any object logic. Just game state. So yeah spawning power ups is game state so I would put it into GameController.

But programming is both Art and Science so if You ask 10 programmers how to solve a problem 10 of them will give You 10 solutions. So it really is what is easier for You to code.