Browse Source

Merge pull request #2303 from Ursus-Z/edited-docs

Edit Exporting code sample to match updated Dodge the Creeps code
Chris Bradfield 6 years ago
parent
commit
6bdb03a0f7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      getting_started/step_by_step/exporting.rst

+ 4 - 4
getting_started/step_by_step/exporting.rst

@@ -55,15 +55,15 @@ changed:
 
 
     signal hit
     signal hit
 
 
-    export (int) var speed
+    export var speed = 400
     var velocity = Vector2()
     var velocity = Vector2()
-    var screensize
+    var screen_size
     # Add this variable to hold the clicked position.
     # Add this variable to hold the clicked position.
     var target = Vector2()
     var target = Vector2()
 
 
     func _ready():
     func _ready():
         hide()
         hide()
-        screensize = get_viewport_rect().size
+        screen_size = get_viewport_rect().size
 
 
     func start(pos):
     func start(pos):
         position = pos
         position = pos
@@ -115,9 +115,9 @@ changed:
             $AnimatedSprite.flip_v = velocity.y > 0
             $AnimatedSprite.flip_v = velocity.y > 0
 
 
     func _on_Player_body_entered( body ):
     func _on_Player_body_entered( body ):
-        $Collision.disabled = true
         hide()
         hide()
         emit_signal("hit")
         emit_signal("hit")
+        $CollisionShape2D.call_deferred("set_disabled", true)
 
 
 Export templates
 Export templates
 ----------------
 ----------------