From 4762af0840b14d114cfae800dffd38d3aa27a9e3 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 3 Sep 2019 08:46:45 -0500 Subject: [PATCH] Add player and main scene. --- main.tscn | 7 +++++++ player.gd | 13 +++++++++++++ player.tscn | 8 ++++++-- project.godot | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 main.tscn create mode 100644 player.gd diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..d2315ed --- /dev/null +++ b/main.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://player.tscn" type="PackedScene" id=1] + +[node name="Main" type="Node"] + +[node name="Player" parent="." instance=ExtResource( 1 )] diff --git a/player.gd b/player.gd new file mode 100644 index 0000000..6ff5ec3 --- /dev/null +++ b/player.gd @@ -0,0 +1,13 @@ +extends Area2D + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/player.tscn b/player.tscn index b0b0c9c..0d49e10 100644 --- a/player.tscn +++ b/player.tscn @@ -1,3 +1,7 @@ -[gd_scene format=2] +[gd_scene load_steps=2 format=2] -[node name="player" type="Area2D"] +[ext_resource path="res://player.gd" type="Script" id=1] + +[node name="Player" type="Area2D"] +position = Vector2( 2, 3 ) +script = ExtResource( 1 ) diff --git a/project.godot b/project.godot index 6785339..63d36aa 100644 --- a/project.godot +++ b/project.godot @@ -15,7 +15,7 @@ _global_script_class_icons={ [application] -run/main_scene="res://player.tscn" +run/main_scene="res://main.tscn" [autoload]