diff --git a/backgounds/galaxy.gd b/backgounds/galaxy.gd index 95f8acc..44887b2 100644 --- a/backgounds/galaxy.gd +++ b/backgounds/galaxy.gd @@ -2,7 +2,7 @@ extends Node2D # Called when the node enters the scene tree for the first time. -var galaxy = load("res://levels/galaxy/galaxy.tscn").instantiate() +var galaxy = load("res://levels/galaxy.tscn").instantiate() func _ready(): get_tree().root.add_child.call_deferred(galaxy) diff --git a/backgounds/wormhole.gd b/backgounds/wormhole.gd new file mode 100644 index 0000000..11824fd --- /dev/null +++ b/backgounds/wormhole.gd @@ -0,0 +1,14 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +var wormhole = load("res://levels/wormhole.tscn").instantiate() + +func _ready(): + get_tree().root.add_child.call_deferred(wormhole) + #pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/backgounds/wormhole.tscn b/backgounds/wormhole.tscn new file mode 100644 index 0000000..ede11b4 --- /dev/null +++ b/backgounds/wormhole.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://by7ktb1k5ml5y"] + +[ext_resource type="Script" path="res://backgounds/wormhole.gd" id="1_fibhv"] +[ext_resource type="Texture2D" uid="uid://bcfmwk0ffy73n" path="res://backgounds/wormhole.png" id="2_6mic1"] + +[node name="wormhole" type="Node2D"] +script = ExtResource("1_fibhv") + +[node name="TextureRect" type="TextureRect" parent="."] +offset_right = 1280.0 +offset_bottom = 720.0 +texture = ExtResource("2_6mic1") diff --git a/bootclick.tscn b/bootclick.tscn index 0c59c9a..c9ef8ef 100644 --- a/bootclick.tscn +++ b/bootclick.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=2 format=3 uid="uid://bet7e2s6kn3mr"] +[gd_scene load_steps=2 format=3 uid="uid://dyaorf0qpfokg"] [ext_resource type="Script" path="res://bootclick.gd" id="1_52bti"] diff --git a/levels/css1.gd b/levels/css1.gd index 77a8d90..46cae7c 100644 --- a/levels/css1.gd +++ b/levels/css1.gd @@ -13,7 +13,7 @@ func _process(delta): var ym = 0 var velocity = Vector2.ZERO if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2: - velocity = (Vector2.RIGHT.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_X))-Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) + velocity = (Vector2.RIGHT.rotated(rotation) * -400 * delta * Input.get_joy_axis(0,JOY_AXIS_LEFT_X))-Vector2.UP.rotated(rotation) * -400 *delta * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) else: if Input.is_action_pressed("ui_left"): xm = -1 @@ -23,7 +23,7 @@ func _process(delta): ym = -1 if Input.is_action_pressed("ui_down"): ym = 1 - velocity = (Vector2.RIGHT.rotated(rotation) * -400 * xm)-Vector2.UP.rotated(rotation) * -400 * ym + velocity = (Vector2.RIGHT.rotated(rotation) * -400 * xm * delta)-Vector2.UP.rotated(rotation) * -400 * ym * delta #if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0: # velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) position += velocity * delta diff --git a/levels/galaxy.gd b/levels/galaxy.gd index 8190b40..ff6389c 100644 --- a/levels/galaxy.gd +++ b/levels/galaxy.gd @@ -6,7 +6,7 @@ var bgsound := AudioStreamPlayer.new() func _ready(): add_child(bgsound) - var titlemusic = load("res://music/alien-bulls.mp3") + var titlemusic = load("res://music/eternity.mp3") bgsound.stream = titlemusic bgsound.play(0) #pass # Replace with function body. diff --git a/levels/wormhole.gd b/levels/wormhole.gd new file mode 100644 index 0000000..8190b40 --- /dev/null +++ b/levels/wormhole.gd @@ -0,0 +1,17 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +var bgsound := AudioStreamPlayer.new() + +func _ready(): + add_child(bgsound) + var titlemusic = load("res://music/alien-bulls.mp3") + bgsound.stream = titlemusic + bgsound.play(0) + #pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/levels/wormhole.tscn b/levels/wormhole.tscn new file mode 100644 index 0000000..927d75c --- /dev/null +++ b/levels/wormhole.tscn @@ -0,0 +1,116 @@ +[gd_scene load_steps=11 format=3 uid="uid://b82huqhu88xt6"] + +[ext_resource type="Script" path="res://levels/galaxy.gd" id="1_x0xiy"] +[ext_resource type="Texture2D" uid="uid://8lioamk650y7" path="res://sprites/css.png" id="2_y6cio"] +[ext_resource type="Script" path="res://levels/css1.gd" id="3_4xg6i"] +[ext_resource type="Texture2D" uid="uid://uscirt5qj0me" path="res://sprites/sat.png" id="4_4mf4s"] +[ext_resource type="Texture2D" uid="uid://dlqjt7dmqfn4m" path="res://sprites/iss.png" id="5_hhxgq"] +[ext_resource type="Texture2D" uid="uid://b8gbi6lsddd0g" path="res://sprites/tc.png" id="6_f0a2t"] +[ext_resource type="Texture2D" uid="uid://dqukmd8obdfhi" path="res://sprites/bus.png" id="7_ymm87"] +[ext_resource type="Texture2D" uid="uid://bows52y4q3suo" path="res://sprites/antenna.png" id="8_7cq8u"] +[ext_resource type="Script" path="res://levels/antenna.gd" id="9_cr36o"] +[ext_resource type="Texture2D" uid="uid://cpd31c6o18rmh" path="res://sprites/ss.png" id="10_shrek"] + +[node name="wormhole" type="Node2D"] +script = ExtResource("1_x0xiy") + +[node name="css1" type="Sprite2D" parent="."] +position = Vector2(852, 455) +scale = Vector2(0.3, 0.3) +texture = ExtResource("2_y6cio") +script = ExtResource("3_4xg6i") + +[node name="css2" type="Sprite2D" parent="."] +position = Vector2(908, 688) +scale = Vector2(0.3, 0.3) +texture = ExtResource("2_y6cio") +script = ExtResource("3_4xg6i") + +[node name="css3" type="Sprite2D" parent="."] +position = Vector2(2931, 925) +scale = Vector2(0.3, 0.3) +texture = ExtResource("2_y6cio") +script = ExtResource("3_4xg6i") + +[node name="sat1" type="Sprite2D" parent="."] +position = Vector2(994, -488) +scale = Vector2(0.3, 0.3) +texture = ExtResource("4_4mf4s") +script = ExtResource("3_4xg6i") + +[node name="sat2" type="Sprite2D" parent="."] +position = Vector2(1177, -4) +scale = Vector2(0.3, 0.3) +texture = ExtResource("4_4mf4s") +script = ExtResource("3_4xg6i") + +[node name="sat3" type="Sprite2D" parent="."] +position = Vector2(2721, -234) +scale = Vector2(0.3, 0.3) +texture = ExtResource("4_4mf4s") +script = ExtResource("3_4xg6i") + +[node name="iss1" type="Sprite2D" parent="."] +position = Vector2(1517, 236) +scale = Vector2(0.5, 0.5) +texture = ExtResource("5_hhxgq") +script = ExtResource("3_4xg6i") + +[node name="iss2" type="Sprite2D" parent="."] +position = Vector2(1991, -175) +scale = Vector2(0.5, 0.5) +texture = ExtResource("5_hhxgq") +script = ExtResource("3_4xg6i") + +[node name="iss3" type="Sprite2D" parent="."] +position = Vector2(3236, 4) +scale = Vector2(0.5, 0.5) +texture = ExtResource("5_hhxgq") +script = ExtResource("3_4xg6i") + +[node name="tc1" type="Sprite2D" parent="."] +position = Vector2(1633, 928) +scale = Vector2(0.3, 0.3) +texture = ExtResource("6_f0a2t") +script = ExtResource("3_4xg6i") + +[node name="tc2" type="Sprite2D" parent="."] +position = Vector2(2258, 1316) +scale = Vector2(0.3, 0.3) +texture = ExtResource("6_f0a2t") +script = ExtResource("3_4xg6i") + +[node name="tc3" type="Sprite2D" parent="."] +position = Vector2(3445, 1440) +scale = Vector2(0.3, 0.3) +texture = ExtResource("6_f0a2t") +script = ExtResource("3_4xg6i") + +[node name="bus1" type="Sprite2D" parent="."] +position = Vector2(991, 1389) +scale = Vector2(0.3, 0.3) +texture = ExtResource("7_ymm87") +script = ExtResource("3_4xg6i") + +[node name="bus2" type="Sprite2D" parent="."] +position = Vector2(2266, 530) +scale = Vector2(0.3, 0.3) +texture = ExtResource("7_ymm87") +script = ExtResource("3_4xg6i") + +[node name="bus3" type="Sprite2D" parent="."] +position = Vector2(3960, 656) +scale = Vector2(0.3, 0.3) +texture = ExtResource("7_ymm87") +script = ExtResource("3_4xg6i") + +[node name="antenna" type="Sprite2D" parent="."] +position = Vector2(3980, -208) +scale = Vector2(0.3, 0.3) +texture = ExtResource("8_7cq8u") +script = ExtResource("9_cr36o") + +[node name="ss" type="Sprite2D" parent="."] +position = Vector2(640, 360) +scale = Vector2(0.3, 0.3) +texture = ExtResource("10_shrek") diff --git a/music/eternity.mp3 b/music/eternity.mp3 new file mode 100644 index 0000000..951d17c Binary files /dev/null and b/music/eternity.mp3 differ diff --git a/music/eternity.mp3.import b/music/eternity.mp3.import new file mode 100644 index 0000000..102b6c1 --- /dev/null +++ b/music/eternity.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://30kc6xpwgn7a" +path="res://.godot/imported/eternity.mp3-d687c70039be7a8d8d6c934ce9739f75.mp3str" + +[deps] + +source_file="res://music/eternity.mp3" +dest_files=["res://.godot/imported/eternity.mp3-d687c70039be7a8d8d6c934ce9739f75.mp3str"] + +[params] + +loop=true +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/title.gd b/title.gd index fcd3de4..bf07a7a 100644 --- a/title.gd +++ b/title.gd @@ -3,6 +3,8 @@ extends Control # Called when the node enters the scene tree for the first time. var bgsound := AudioStreamPlayer.new() +#var galaxy = preload("res://backgounds/galaxy.tscn").instantiate() +#var wormhole = preload("res://backgounds/wormhole.tscn").instantiate() func _ready(): add_child(bgsound) @@ -15,3 +17,20 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass + +func _input(event): + # Mouse in viewport coordinates. + if event is InputEventMouseButton || Input.is_joy_button_pressed(0,JOY_BUTTON_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_Y) || Input.is_joy_button_pressed(0,JOY_BUTTON_A) || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK) || Input.is_joy_button_pressed(0,JOY_BUTTON_START) || Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) || Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_SHOULDER): + #print("Mouse Click/Unclick at: ", event.position) + _level() + +func _level(): + # This is like autoloading the scene, only + # it happens after already loading the main scene. + if fmod(Time.get_unix_time_from_system(), 2) == 0: + get_tree().change_scene_to_file("res://backgounds/galaxy.tscn") + else: + get_tree().change_scene_to_file("res://backgounds/wormhole.tscn") + #get_tree().root.add_child(title) + #get_tree().root.remove_child(boot) + #boot.queue_free()