diff options
-rw-r--r-- | .import/background.png-c1b07215c0c7a4566a55dfd2136f642d.md5 | 3 | ||||
-rw-r--r-- | .import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex | bin | 0 -> 10628 bytes | |||
-rw-r--r-- | .import/rooot.png-53269f53a9eb787988926f90e6b542fb.md5 | 3 | ||||
-rw-r--r-- | .import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex | bin | 0 -> 1431 bytes | |||
-rw-r--r-- | Camera2D.gd | 36 | ||||
-rw-r--r-- | default_env.tres | 1 | ||||
-rw-r--r-- | hackingscene.tscn | 30 | ||||
-rw-r--r-- | project.godot | 5 | ||||
-rw-r--r-- | textures/background.png | bin | 0 -> 11075 bytes | |||
-rw-r--r-- | textures/background.png.import | 34 | ||||
-rw-r--r-- | textures/rooot.png | bin | 0 -> 1529 bytes | |||
-rw-r--r-- | textures/rooot.png.import | 34 |
12 files changed, 145 insertions, 1 deletions
diff --git a/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.md5 b/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.md5 new file mode 100644 index 0000000..cc1e60e --- /dev/null +++ b/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.md5 @@ -0,0 +1,3 @@ +source_md5="0c9bd546022c8342afbaf1fe2d1acbaa" +dest_md5="24c64d22795dec7111beaa45f2c8c003" + diff --git a/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex b/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex Binary files differnew file mode 100644 index 0000000..c592889 --- /dev/null +++ b/.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex diff --git a/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.md5 b/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.md5 new file mode 100644 index 0000000..e4c09f6 --- /dev/null +++ b/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.md5 @@ -0,0 +1,3 @@ +source_md5="546a869b294454060923e005ca913494" +dest_md5="37c68bd62cbf03a2dcbf41fde0b01eb4" + diff --git a/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex b/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex Binary files differnew file mode 100644 index 0000000..74f4e36 --- /dev/null +++ b/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex diff --git a/Camera2D.gd b/Camera2D.gd new file mode 100644 index 0000000..d994397 --- /dev/null +++ b/Camera2D.gd @@ -0,0 +1,36 @@ +extends Camera2D + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +onready var path : Path2D = get_node(@"../Path2D") +onready var points = path.curve.get_baked_points() +export var max_speed = 10 + +var pidx = 0 +# Called when the node enters the scene tree for the first time. +func _ready(): + pass + +func current_speed(): + return max_speed + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if pidx == -1: + return + var next_point = points[pidx] + var dist : Vector2 = next_point - position + print(dist.length(),"\t", current_speed() * delta) + if dist.length() - current_speed() * delta < 0.5: + position = next_point + pidx += 1 + if pidx >= points.size(): + pidx = -1 + return + var velocity = dist.normalized() * current_speed() * delta + position += velocity + + diff --git a/default_env.tres b/default_env.tres index 4970d45..fe7e3fe 100644 --- a/default_env.tres +++ b/default_env.tres @@ -3,6 +3,5 @@ [sub_resource type="ProceduralSky" id=1] [resource] -background_mode = 1 background_sky = SubResource( 1 ) background_color = Color( 0.305882, 0.164706, 0.164706, 1 ) diff --git a/hackingscene.tscn b/hackingscene.tscn new file mode 100644 index 0000000..d4decc3 --- /dev/null +++ b/hackingscene.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://textures/background.png" type="Texture" id=1] +[ext_resource path="res://textures/rooot.png" type="Texture" id=2] +[ext_resource path="res://Camera2D.gd" type="Script" id=3] + +[sub_resource type="Curve2D" id=1] +_data = { +"points": PoolVector2Array( 0, 0, 0, 0, 377.292, 120.601, 0, 0, 0, 0, 395.251, 374.278, 0, 0, 0, 0, 541.172, 385.502, 0, 0, 0, 0, 837.501, 345.094, 0, 0, 0, 0, 922.809, 55.4985, 0, 0, 0, 0, 538.927, -58.9926, 0, 0, 0, 0, 538.927, 163.255, 0, 0, 0, 0, 1266.28, 161.01, 0, 0, 0, 0, 1057.5, -296.955, 0, 0, 0, 0, 693.826, 64.4782, 0, 0, 0, 0, 833.012, -213.892 ) +} + +[node name="Node2D" type="Node2D"] + +[node name="Camera2D" type="Camera2D" parent="."] +current = true +script = ExtResource( 3 ) +max_speed = 100 + +[node name="Sprite" type="Sprite" parent="Camera2D"] +position = Vector2( 1.49817, -0.0841775 ) +scale = Vector2( 0.539243, 0.564739 ) +texture = ExtResource( 1 ) + +[node name="Path2D" type="Path2D" parent="."] +curve = SubResource( 1 ) + +[node name="rooot" type="Sprite" parent="."] +position = Vector2( 593.927, 265.399 ) +scale = Vector2( 0.298461, 0.320911 ) +texture = ExtResource( 2 ) diff --git a/project.godot b/project.godot index e2b47f4..879bf92 100644 --- a/project.godot +++ b/project.godot @@ -13,6 +13,11 @@ config_version=4 config/name="Deeper and Deeper" config/icon="res://icon.png" +[display] + +window/stretch/mode="2d" +window/stretch/aspect="keep" + [input] mv_up={ diff --git a/textures/background.png b/textures/background.png Binary files differnew file mode 100644 index 0000000..2afcee3 --- /dev/null +++ b/textures/background.png diff --git a/textures/background.png.import b/textures/background.png.import new file mode 100644 index 0000000..1325663 --- /dev/null +++ b/textures/background.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/background.png" +dest_files=[ "res://.import/background.png-c1b07215c0c7a4566a55dfd2136f642d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/textures/rooot.png b/textures/rooot.png Binary files differnew file mode 100644 index 0000000..55a0732 --- /dev/null +++ b/textures/rooot.png diff --git a/textures/rooot.png.import b/textures/rooot.png.import new file mode 100644 index 0000000..0a8a9c4 --- /dev/null +++ b/textures/rooot.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/rooot.png" +dest_files=[ "res://.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 |