It seems like you have opened this file by double-clicking on it. In order to test your build in a browser you need to load this file from a web server. You can either upload this file and the rest of the files from a Defold HTML5 bundle to a web hosting service OR host them using a local web server on your home network.
This example shows how to dynamically spawn bullet game objects using a factory component and how to also move and delete the bullets. The setup consists of two game objects; one for the player and one for the bullet that is spawned using a factory component.
Combine this example with some of the examples from the movement and physics categories to create a shoot ‘em up game!
The red ship at the bottom. Contains:
A Sprite component with the spaceship image.
A Factory component to spawn bullet game objects
A script to handle spawning of bullets.
The bullet fired by the player. Contains:
A Sprite component with a bullet image.
If you want to play with these examples, you can get the project on Github.
Do you want to see more examples? Why not write a few yourself and submit a pull request? We love contributions.