summaryrefslogtreecommitdiff
path: root/demos/2d/space_shooter/rail.gd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2015-11-21 16:13:43 +0100
committerRémi Verschelde <rverschelde@gmail.com>2015-12-09 08:39:12 +0100
commit7589b2bf605b58fbb0e34dec8ae833708e9b54ea (patch)
tree6c6b6515be9d121127f738a586fd95299ca7018a /demos/2d/space_shooter/rail.gd
parent323dde7f3164477b3d51fda8352d8b37a19f7f9d (diff)
Improve code formatting
The scripts were streamlined using more or less the following conventions: - space after a comma in lists of arguments - spaces around weak operators (+, -), no spaces around strong operators (*, /) - spaces around comparison operators and compound assignment operators - space after a comment start (#) - removed trailing spaces or tabs, apart from those that delimit the function indentation level (those could be removed too but since they are added automatically by the editor when typing code, keeping them for now) - function blocks separate by two newlines - comment sentences start with an upper-case letter
Diffstat (limited to 'demos/2d/space_shooter/rail.gd')
-rw-r--r--demos/2d/space_shooter/rail.gd19
1 files changed, 7 insertions, 12 deletions
diff --git a/demos/2d/space_shooter/rail.gd b/demos/2d/space_shooter/rail.gd
index 22ebd02670..b00684a98f 100644
--- a/demos/2d/space_shooter/rail.gd
+++ b/demos/2d/space_shooter/rail.gd
@@ -1,25 +1,20 @@
extends Node2D
+# Member variables
+const SPEED = 200
+var offset = 0
-const SPEED=200
-# member variables here, example:
-# var a=2
-# var b="textvar"
func stop():
set_process(false)
-var offset=0
-
func _process(delta):
- offset+=delta*SPEED
- set_pos(Vector2(offset,0))
+ offset += delta*SPEED
+ set_pos(Vector2(offset, 0))
+
func _ready():
- set_process(true)
# Initialization here
-
-
-
+ set_process(true)