mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-05 23:40:07 +01:00
Use upper-cased first letter at the start of comment sentences
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
extends Node
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var current_scene = null
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ func _deferred_goto_scene(path):
|
||||
|
||||
func _ready():
|
||||
# Get the current scene, the first time.
|
||||
# it is always the last child of root,
|
||||
# It is always the last child of root,
|
||||
# after the autoloaded nodes.
|
||||
|
||||
var root = get_tree().get_root()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
@@ -13,4 +13,4 @@ func _ready():
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_b.scn")
|
||||
pass # replace with function body
|
||||
pass # Replace with function body
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
@@ -13,4 +13,4 @@ func _ready():
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_a.scn")
|
||||
pass # replace with function body
|
||||
pass # Replace with function body
|
||||
|
||||
@@ -8,7 +8,7 @@ extends Node2D
|
||||
#
|
||||
# Licensed under the MIT license
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var joy_num
|
||||
var cur_joy
|
||||
var axis_value
|
||||
@@ -16,21 +16,21 @@ var btn_state
|
||||
|
||||
|
||||
func _input(event):
|
||||
# get the joystick device number from the spinbox
|
||||
# Get the joystick device number from the spinbox
|
||||
joy_num = get_node("joy_num").get_value()
|
||||
|
||||
# display the name of the joystick if we haven't already
|
||||
# Display the name of the joystick if we haven't already
|
||||
if joy_num != cur_joy:
|
||||
cur_joy = joy_num
|
||||
get_node("joy_name").set_text(Input.get_joy_name(joy_num))
|
||||
|
||||
# loop through the axes and show their current values
|
||||
# Loop through the axes and show their current values
|
||||
for axis in range(0, 8):
|
||||
axis_value = Input.get_joy_axis(joy_num, axis)
|
||||
get_node("axis_prog" + str(axis)).set_value(100*axis_value)
|
||||
get_node("axis_val" + str(axis)).set_text(str(axis_value))
|
||||
|
||||
# loop through the buttons and highlight the ones that are pressed
|
||||
# Loop through the buttons and highlight the ones that are pressed
|
||||
for btn in range(0, 17):
|
||||
btn_state = 1
|
||||
if (Input.is_joy_button_pressed(joy_num, btn)):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends VBoxContainer
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var regex = RegEx.new()
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
@@ -13,4 +13,4 @@ func _ready():
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_b.scn")
|
||||
pass # replace with function body
|
||||
pass # Replace with function body
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
@@ -13,4 +13,4 @@ func _ready():
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_a.scn")
|
||||
pass # replace with function body
|
||||
pass # Replace with function body
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var thread = Thread.new()
|
||||
|
||||
|
||||
# this function runs in a thread!
|
||||
# threads always take one userdata argument
|
||||
# This function runs in a thread!
|
||||
# Threads always take one userdata argument
|
||||
func _bg_load(path):
|
||||
print("THREAD FUNC!")
|
||||
# load the resource
|
||||
# Load the resource
|
||||
var tex = ResourceLoader.load(path)
|
||||
# call _bg_load_done on main thread
|
||||
# Call _bg_load_done on main thread
|
||||
call_deferred("_bg_load_done")
|
||||
return tex # return it
|
||||
|
||||
|
||||
func _bg_load_done():
|
||||
# wait for the thread to complete, get the returned value
|
||||
# Wait for the thread to complete, get the returned value
|
||||
var tex = thread.wait_to_finish()
|
||||
# set to the sprite
|
||||
# Set to the sprite
|
||||
get_node("sprite").set_texture(tex)
|
||||
|
||||
|
||||
func _on_load_pressed():
|
||||
if (thread.is_active()):
|
||||
# already working
|
||||
# Already working
|
||||
return
|
||||
print("START THREAD!")
|
||||
thread.start(self, "_bg_load", "res://mona.png")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Control
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var trans = ["linear", "sine", "quint", "quart", "quad", "expo", "elastic", "cubic", "circ", "bounce", "back"]
|
||||
var eases = ["in", "out", "in_out", "out_in"]
|
||||
var modes = ["move", "color", "scale", "rotate", "callback", "follow", "repeat", "pause"]
|
||||
|
||||
@@ -5,7 +5,7 @@ extends Panel
|
||||
# (UDP can lose packets and you won't normally find out, so don't do a chat this way)
|
||||
# This is just a demo that shows how to use the UDP class.
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var udp = PacketPeerUDP.new()
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Control
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var mousepos
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
extends Spatial
|
||||
|
||||
# member variables
|
||||
# Member variables
|
||||
var r_pos = Vector2()
|
||||
var state
|
||||
|
||||
@@ -29,7 +29,7 @@ func _fixed_process(delta):
|
||||
if(Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
var dir = Vector3()
|
||||
var dir = Vector3()
|
||||
var cam = get_global_transform()
|
||||
var org = get_translation()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user