Time for action — adding some guns
Our players will need some tools to fight off any enemies we add later. Let us do this by adding in guns and bullets for them to use.
1. In the
Layout Editor
, select theObjects
layer and create a sprite namedPistolShot
and paste the pistol bullet into it. Give this sprite theAttribute
ofDestroy on startup
and aPrivate Variable
namedDamage
with value22
.2. Now set the
Collisions
mode toBounding Box
and add the object to a new family calledBullets
.3. Add the
Bullet
behavior and give it settings to match the following screenshot:4. Clone this object and call it
UziShot
. Paste the uzi bullet image into it, set theDamage
of this object to20
instead, and have itsBullet
settings match those shown in the following screenshot:5. Do the same again for the
ShotgunShot
object, this time having aDamage
of18
andBullet
settings to match the following screenshot:6. Now create a
Sprite
namedPistol
and paste the pistol graphic into it. Have this object...