aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar perivesta <>2023-07-09 15:45:42 +0200
committerLibravatar perivesta <>2023-07-09 15:45:42 +0200
commit0c0674dc05d71ab156b7077f4415b78135d7c1cc (patch)
treef2cd3f6ced34539e0b6de4ad43aa7b492821e1b2
parent5b1a456768f0072e10577f52914898473385e72b (diff)
download2023-0c0674dc05d71ab156b7077f4415b78135d7c1cc.tar.gz
2023-0c0674dc05d71ab156b7077f4415b78135d7c1cc.tar.bz2
2023-0c0674dc05d71ab156b7077f4415b78135d7c1cc.zip
more sprites
-rw-r--r--Levels/LevelTemplate.tscn12
-rw-r--r--Levels/Level_test_2.tscn (renamed from Nodes/Level_test_2.tscn)0
-rw-r--r--Levels/Tut01.tscn16
-rw-r--r--Levels/Tut02.tscn15
-rw-r--r--Levels/Tut03.tscn12
-rw-r--r--Nodes/car.tscn9
-rw-r--r--Nodes/checkpoint.tscn9
-rw-r--r--Scripts/Checkpoint.gd8
-rw-r--r--Scripts/car_behaviour.gd3
9 files changed, 25 insertions, 59 deletions
diff --git a/Levels/LevelTemplate.tscn b/Levels/LevelTemplate.tscn
index 18d6366..217a0b4 100644
--- a/Levels/LevelTemplate.tscn
+++ b/Levels/LevelTemplate.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=11 format=3 uid="uid://dliou1u4o6bib"]
+[gd_scene load_steps=10 format=3 uid="uid://dliou1u4o6bib"]
[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_2b4bf"]
[ext_resource type="PackedScene" uid="uid://c8r6i3bu37ogu" path="res://Nodes/ui.tscn" id="2_2w0c4"]
@@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://cxhterify3l" path="res://Assets/Images/goal.png" id="4_x2h7q"]
[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="5_v816p"]
[ext_resource type="Script" path="res://Scripts/drawing.gd" id="6_ihf71"]
-[ext_resource type="Texture2D" uid="uid://dg3v488vx0oj6" path="res://Assets/checkpoint.png" id="7_bofa3"]
[ext_resource type="TileSet" uid="uid://cl8153posdeim" path="res://Assets/grass_tile_set.tres" id="8_7sh6f"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6g88q"]
@@ -51,15 +50,6 @@ curve = SubResource("Curve2D_0exre")
[node name="TrackFollower" type="PathFollow2D" parent="DrawNode/TrackPath"]
loop = false
-[node name="Sprite2D" type="Sprite2D" parent="DrawNode/TrackPath/TrackFollower"]
-visible = false
-scale = Vector2(0.604, 0.604)
-texture = ExtResource("7_bofa3")
-
-[node name="31005" type="Timer" parent="DrawNode/TrackPath/TrackFollower"]
-wait_time = 0.2
-one_shot = true
-
[node name="Checkpoints" type="Node" parent="."]
[node name="TileMap" type="TileMap" parent="."]
diff --git a/Nodes/Level_test_2.tscn b/Levels/Level_test_2.tscn
index fff7252..fff7252 100644
--- a/Nodes/Level_test_2.tscn
+++ b/Levels/Level_test_2.tscn
diff --git a/Levels/Tut01.tscn b/Levels/Tut01.tscn
index d0ee5c6..d7441dc 100644
--- a/Levels/Tut01.tscn
+++ b/Levels/Tut01.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=12 format=3 uid="uid://bp56skqd5gqub"]
+[gd_scene load_steps=11 format=3 uid="uid://bp56skqd5gqub"]
[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_lcu5v"]
[ext_resource type="PackedScene" uid="uid://c8r6i3bu37ogu" path="res://Nodes/ui.tscn" id="2_44idh"]
@@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://cxhterify3l" path="res://Assets/Images/goal.png" id="4_mfiv7"]
[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="5_mi6tb"]
[ext_resource type="Script" path="res://Scripts/drawing.gd" id="6_0pqvb"]
-[ext_resource type="Texture2D" uid="uid://dg3v488vx0oj6" path="res://Assets/checkpoint.png" id="7_00bmf"]
[ext_resource type="TileSet" uid="uid://cl8153posdeim" path="res://Assets/grass_tile_set.tres" id="8_wphs7"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6g88q"]
@@ -55,15 +54,6 @@ curve = SubResource("Curve2D_0exre")
[node name="TrackFollower" type="PathFollow2D" parent="DrawNode/TrackPath"]
loop = false
-[node name="Sprite2D" type="Sprite2D" parent="DrawNode/TrackPath/TrackFollower"]
-visible = false
-scale = Vector2(0.604, 0.604)
-texture = ExtResource("7_00bmf")
-
-[node name="31005" type="Timer" parent="DrawNode/TrackPath/TrackFollower"]
-wait_time = 0.2
-one_shot = true
-
[node name="Checkpoints" type="Node" parent="."]
[node name="Control" type="Control" parent="."]
@@ -77,9 +67,9 @@ grow_vertical = 2
[node name="Label" type="Label" parent="Control"]
layout_mode = 0
offset_left = 124.0
-offset_top = 378.0
+offset_top = 440.0
offset_right = 398.0
-offset_bottom = 404.0
+offset_bottom = 466.0
text = "Click here to start drawing the road"
label_settings = SubResource("LabelSettings_sv8of")
diff --git a/Levels/Tut02.tscn b/Levels/Tut02.tscn
index ff34cd0..daf1ca0 100644
--- a/Levels/Tut02.tscn
+++ b/Levels/Tut02.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=12 format=3 uid="uid://ccgojoehaouv0"]
+[gd_scene load_steps=11 format=3 uid="uid://ccgojoehaouv0"]
[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_77i7n"]
[ext_resource type="PackedScene" uid="uid://c8r6i3bu37ogu" path="res://Nodes/ui.tscn" id="2_wchsl"]
@@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://cxhterify3l" path="res://Assets/Images/goal.png" id="4_yklwl"]
[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="5_h0kjy"]
[ext_resource type="Script" path="res://Scripts/drawing.gd" id="6_0m5bn"]
-[ext_resource type="Texture2D" uid="uid://dg3v488vx0oj6" path="res://Assets/checkpoint.png" id="7_xyp4c"]
[ext_resource type="TileSet" uid="uid://cl8153posdeim" path="res://Assets/grass_tile_set.tres" id="8_a1rvy"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6g88q"]
@@ -22,7 +21,6 @@ outline_color = Color(0, 0, 0, 1)
script = ExtResource("1_77i7n")
[node name="UI" parent="." instance=ExtResource("2_wchsl")]
-visible = false
[node name="Start" type="Node2D" parent="."]
position = Vector2(256, 422)
@@ -35,7 +33,6 @@ offset_bottom = 9.0
texture_normal = ExtResource("3_eeg1f")
[node name="FinishLine" type="Sprite2D" parent="."]
-visible = false
position = Vector2(983, 158)
texture = ExtResource("4_yklwl")
@@ -57,15 +54,6 @@ curve = SubResource("Curve2D_0exre")
[node name="TrackFollower" type="PathFollow2D" parent="DrawNode/TrackPath"]
loop = false
-[node name="Sprite2D" type="Sprite2D" parent="DrawNode/TrackPath/TrackFollower"]
-visible = false
-scale = Vector2(0.604, 0.604)
-texture = ExtResource("7_xyp4c")
-
-[node name="31005" type="Timer" parent="DrawNode/TrackPath/TrackFollower"]
-wait_time = 0.2
-one_shot = true
-
[node name="Checkpoints" type="Node" parent="."]
[node name="Control" type="Control" parent="."]
@@ -86,7 +74,6 @@ text = "Sand is off limits and the car won't go there"
label_settings = SubResource("LabelSettings_sv8of")
[node name="TileMap" type="TileMap" parent="."]
-visible = false
z_index = -1
tile_set = ExtResource("8_a1rvy")
format = 2
diff --git a/Levels/Tut03.tscn b/Levels/Tut03.tscn
index 1aa974a..42ac325 100644
--- a/Levels/Tut03.tscn
+++ b/Levels/Tut03.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=13 format=3 uid="uid://ceoxn74ev4wui"]
+[gd_scene load_steps=12 format=3 uid="uid://ceoxn74ev4wui"]
[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_6ktyo"]
[ext_resource type="PackedScene" uid="uid://c8r6i3bu37ogu" path="res://Nodes/ui.tscn" id="2_cbrmn"]
@@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://cxhterify3l" path="res://Assets/Images/goal.png" id="4_a601a"]
[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="5_hgfxg"]
[ext_resource type="Script" path="res://Scripts/drawing.gd" id="6_uikm8"]
-[ext_resource type="Texture2D" uid="uid://dg3v488vx0oj6" path="res://Assets/checkpoint.png" id="7_ius8n"]
[ext_resource type="TileSet" uid="uid://cl8153posdeim" path="res://Assets/grass_tile_set.tres" id="8_1mcey"]
[ext_resource type="PackedScene" uid="uid://wkfai2lvnp7n" path="res://Nodes/checkpoint.tscn" id="8_7nfp6"]
@@ -56,15 +55,6 @@ curve = SubResource("Curve2D_0exre")
[node name="TrackFollower" type="PathFollow2D" parent="DrawNode/TrackPath"]
loop = false
-[node name="Sprite2D" type="Sprite2D" parent="DrawNode/TrackPath/TrackFollower"]
-visible = false
-scale = Vector2(0.604, 0.604)
-texture = ExtResource("7_ius8n")
-
-[node name="31005" type="Timer" parent="DrawNode/TrackPath/TrackFollower"]
-wait_time = 0.2
-one_shot = true
-
[node name="Checkpoints" type="Node" parent="."]
[node name="Checkpoint" parent="Checkpoints" instance=ExtResource("8_7nfp6")]
diff --git a/Nodes/car.tscn b/Nodes/car.tscn
index dbfb4e1..c3eb2a6 100644
--- a/Nodes/car.tscn
+++ b/Nodes/car.tscn
@@ -1,17 +1,18 @@
[gd_scene load_steps=4 format=3 uid="uid://c1mvbh2fwqtkb"]
[ext_resource type="Script" path="res://Scripts/car_behaviour.gd" id="1_0e4ux"]
-
-[sub_resource type="CanvasTexture" id="CanvasTexture_aacgf"]
+[ext_resource type="Texture2D" uid="uid://cjb81lukqo6n4" path="res://Assets/Images/car2.png" id="2_wteha"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wvlyu"]
+size = Vector2(32, 14)
[node name="Car" type="CharacterBody2D"]
script = ExtResource("1_0e4ux")
[node name="Sprite2D" type="Sprite2D" parent="."]
-scale = Vector2(19.92, 19.76)
-texture = SubResource("CanvasTexture_aacgf")
+visible = false
+rotation = 1.5708
+texture = ExtResource("2_wteha")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_wvlyu")
diff --git a/Nodes/checkpoint.tscn b/Nodes/checkpoint.tscn
index 458f121..5d95f7a 100644
--- a/Nodes/checkpoint.tscn
+++ b/Nodes/checkpoint.tscn
@@ -1,7 +1,8 @@
-[gd_scene load_steps=4 format=3 uid="uid://wkfai2lvnp7n"]
+[gd_scene load_steps=5 format=3 uid="uid://wkfai2lvnp7n"]
[ext_resource type="Script" path="res://Scripts/Checkpoint.gd" id="1_fwyov"]
[ext_resource type="Texture2D" uid="uid://2jhabylue78s" path="res://Assets/Images/checkpoint_open.png" id="2_62gva"]
+[ext_resource type="Texture2D" uid="uid://c016iy5c3e472" path="res://Assets/Images/checkpoint_closed_2.png" id="3_ud10i"]
[sub_resource type="CircleShape2D" id="CircleShape2D_q6wen"]
radius = 17.0294
@@ -14,7 +15,11 @@ script = ExtResource("1_fwyov")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_q6wen")
-[node name="Sprite2D" type="Sprite2D" parent="."]
+[node name="Sprite2Dopen" type="Sprite2D" parent="."]
texture = ExtResource("2_62gva")
+[node name="Sprite2Dclosed" type="Sprite2D" parent="."]
+visible = false
+texture = ExtResource("3_ud10i")
+
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
diff --git a/Scripts/Checkpoint.gd b/Scripts/Checkpoint.gd
index d8c671e..565afef 100644
--- a/Scripts/Checkpoint.gd
+++ b/Scripts/Checkpoint.gd
@@ -3,15 +3,15 @@ extends Node2D
var was_visited = false
-@onready var sprite : Sprite2D = $Sprite2D
-
func set_was_visited(visited: bool):
was_visited = visited
if(visited):
- hide()
+# $Sprite2Dopen.hide()
+ $Sprite2Dclosed.show()
else:
- show()
+ $Sprite2Dclosed.hide()
+# $Sprite2Dopen.show()
# TODO change the sprite to indicate the change
func _on_area_2d_body_entered(body):
diff --git a/Scripts/car_behaviour.gd b/Scripts/car_behaviour.gd
index 8c22bf3..1a69b37 100644
--- a/Scripts/car_behaviour.gd
+++ b/Scripts/car_behaviour.gd
@@ -29,7 +29,10 @@ func _ready():
func _physics_process(delta):
if not driving:
+ $Sprite2D.hide()
return
+
+ $Sprite2D.show()
# Code for getting the next desired direction based on the environment
set_interest()