Trying to create a shooter only upwards

Hi, im trying to create a shooter whereby the player is at the bottom of the screen, space is the hash to fire, and the bullets need to spawn and shoot upwards. I cant figure out how to do this and the defold tutorials wont work for some reason. Im new to defold, and also extremely bad at coding so please dumb anything down for me ahaha. thank you!

1 Like

Have a look at @Pawel 's Unfolding Defold series on YouTube:

https://www.youtube.com/@unfolding_gamedev/videos

2 Likes

Exactly, there is literally the tutorial for beginners on making a space shooter game! :smiley:

For shooting with Space, after watching the tutorial, you might be able to replace my automatic shooting with just handling the space key (as it was introduced for arrows) to shoot them

If you will have questions then, let us know! :wink:

Also take a look at this example:

1 Like

This code didn’t work for me but it is perfect for what i need. I have sorted the issue, marginally, but my sprite also wont show up when i build the game, it has a collision object and script attached to say when hit, delete, but wont show up when i build.

When i move my bullet sprite around the main collection it also changes whether the bullet moves upwards or downwards when i build it? why is this?

I am watching them, but for some reason when I move my sprites around on the collection it completely changes what they do. Those videos are a god send though. I have copied every step but my enemy sprite doesnt load when the game is built.

You should look at the position of your Game Objects and the sprites attached to them. You should set the z value to 0 for everything (for now). That might help

You should also set all rotations to (for game objects and sprites) 0 and see if that helps. And remember, you can rotate the sprite without rotating the game object. If the Game object is moving in the right direction, but the sprite is facing the wrong direction, that will help.

1 Like

Another random pitfall: collision objects accidentally set to dynamic will fall off the screen.

2 Likes