Tile map added
This commit is contained in:
1 parent
c8753c98a6
commit
c550f9acaa
13 files changed
+337
-80
No files matched your search
@@ -41,13 +41,21 @@ func _physics_process(delta):
|
||||
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
#make a bullet
|
||||
var myBullet = bullet.instantiate()
|
||||
var myBullet = bullet.instantiate() #you can only instantiate a scene
|
||||
#set bullet speed?
|
||||
|
||||
#put the bullet at the Marker
|
||||
owner.add_child(myBullet)
|
||||
myBullet.transform = marker_right.global_transform
|
||||
pass
|
||||
owner.add_child(myBullet) #owner because its adding it to the game and not the character.
|
||||
#This is important because if the character jumps you don't want the bullet to jump as well.
|
||||
if not faceLeft:
|
||||
#facing right
|
||||
myBullet.transform = marker_right.global_transform
|
||||
else:
|
||||
myBullet.transform = marker_left.global_transform
|
||||
myBullet.setSpeed(-750) #Tim changed it to -750. Magic number. Not sure why.
|
||||
|
||||
#remove the pass at the end
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
var direction = Input.get_axis("ui_left", "ui_right")
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ func _physics_process(delta):
|
||||
|
||||
func _on_body_entered(body):
|
||||
print("bullet hit something")
|
||||
if not body.is_in_group("player"):
|
||||
if not body.is_in_group("player"): #if it hits something other than the player, then disappear
|
||||
queue_free()
|
||||
Reference in new issue
Block a user