From 8639cecf4cedd56452b47503be19c44b304cd02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 9 Dec 2015 08:38:23 +0100 Subject: Improve code formatting and update to 2.0 The scripts were streamlined using more or less the following conventions: - space after a comma in lists of arguments - space around weak operators (+, -), no space around strong 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 The scene files were resaved with the (current) 2.0 format, and some scenes that were in XML format were converted to SCN, to be consistent across all demos. --- demos/3d/platformer/coin.gd | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'demos/3d/platformer/coin.gd') diff --git a/demos/3d/platformer/coin.gd b/demos/3d/platformer/coin.gd index 8bf1a3460d..ef84014931 100644 --- a/demos/3d/platformer/coin.gd +++ b/demos/3d/platformer/coin.gd @@ -1,23 +1,11 @@ extends Area -# member variables here, example: -# var a=2 -# var b="textvar" - - +# member variables var taken = false -func _on_coin_body_enter( body ): +func _on_coin_body_enter(body): if (not taken and body extends preload("res://player.gd")): get_node("anim").play("take") taken=true - - -func _ready(): - # Initalization here - pass - - - -- cgit v1.2.3 From 8c4f19e79d3e8ac8bc8c283073dce5ccfbf222b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 21 Nov 2015 13:31:25 +0100 Subject: Use upper-cased first letter at the start of comment sentences --- demos/3d/platformer/coin.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/3d/platformer/coin.gd') diff --git a/demos/3d/platformer/coin.gd b/demos/3d/platformer/coin.gd index ef84014931..bd2eea81e2 100644 --- a/demos/3d/platformer/coin.gd +++ b/demos/3d/platformer/coin.gd @@ -1,11 +1,11 @@ extends Area -# member variables +# Member variables var taken = false func _on_coin_body_enter(body): if (not taken and body extends preload("res://player.gd")): get_node("anim").play("take") - taken=true + taken = true -- cgit v1.2.3