diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index 3289cac..ab653ea 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -9,7 +9,7 @@ [ext_resource path="res://Images and Anims/In Game/coin.png" type="Texture" id=7] [ext_resource path="res://Music and Sounds/explosion.ogg" type="AudioStream" id=8] [ext_resource path="res://Music and Sounds/astervoid-theme.ogg" type="AudioStream" id=9] -[ext_resource path="res://Music and Sounds/rocket-launch.ogg" type="AudioStream" id=10] +[ext_resource path="res://Music and Sounds/rocket-launch.mp3" type="AudioStream" id=10] [ext_resource path="res://Images and Anims/In Game/playbutton.png" type="Texture" id=11] [sub_resource type="AtlasTexture" id=1] @@ -83,7 +83,7 @@ __meta__ = { position = Vector2( -8.0022, -34.2137 ) scale = Vector2( 0.401688, 0.401688 ) frames = SubResource( 6 ) -frame = 4 +frame = 3 playing = true [node name="Theme Music" type="AudioStreamPlayer" parent="Rocket"] diff --git a/Game Scenes/Main Menu.tscn b/Game Scenes/Main Menu.tscn index da73743..5ef8c3b 100644 --- a/Game Scenes/Main Menu.tscn +++ b/Game Scenes/Main Menu.tscn @@ -131,7 +131,7 @@ position = Vector2( 0, -576 ) scale = Vector2( 3, 3 ) frames = SubResource( 8 ) animation = "spin" -frame = 3 +frame = 1 playing = true [node name="Label" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/Coin"] diff --git a/Music and Sounds/rocket-launch.mp3 b/Music and Sounds/rocket-launch.mp3 new file mode 100644 index 0000000..301c972 Binary files /dev/null and b/Music and Sounds/rocket-launch.mp3 differ diff --git a/Music and Sounds/rocket-launch.mp3.import b/Music and Sounds/rocket-launch.mp3.import new file mode 100644 index 0000000..31cb61d --- /dev/null +++ b/Music and Sounds/rocket-launch.mp3.import @@ -0,0 +1,15 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +path="res://.import/rocket-launch.mp3-d1781197b8b9e95b3d22056875d3a74c.mp3str" + +[deps] + +source_file="res://Music and Sounds/rocket-launch.mp3" +dest_files=[ "res://.import/rocket-launch.mp3-d1781197b8b9e95b3d22056875d3a74c.mp3str" ] + +[params] + +loop=true +loop_offset=0 diff --git a/Music and Sounds/rocket-launch.ogg.import b/Music and Sounds/rocket-launch.ogg.import index 3abd955..556de85 100644 --- a/Music and Sounds/rocket-launch.ogg.import +++ b/Music and Sounds/rocket-launch.ogg.import @@ -2,13 +2,11 @@ importer="ogg_vorbis" type="AudioStreamOGGVorbis" -path="res://.import/rocket-launch.ogg-8d561e573504190ba6fe4ff074c316cf.oggstr" +valid=false [deps] source_file="res://Music and Sounds/rocket-launch.ogg" -dest_files=[ "res://.import/rocket-launch.ogg-8d561e573504190ba6fe4ff074c316cf.oggstr" ] - [params] loop=false diff --git a/Objects/Rocket.tscn b/Objects/Rocket.tscn index 48128b3..684d211 100644 --- a/Objects/Rocket.tscn +++ b/Objects/Rocket.tscn @@ -515,5 +515,5 @@ position = Vector2( 0, 47.5 ) rotation = 1.5708 frames = SubResource( 122 ) animation = "New Anim" -frame = 33 +frame = 55 playing = true diff --git a/Scripts/Game.gd b/Scripts/Game.gd index fedb22e..7e55776 100644 --- a/Scripts/Game.gd +++ b/Scripts/Game.gd @@ -45,7 +45,8 @@ func _process(delta): var spawnx = rand_range($Rocket.position.x - get_viewport_rect().size.x, $Rocket.position.x + get_viewport_rect().size.x) asteroid.position.x = spawnx if (spawnx < $Rocket.position.x - get_viewport_rect().size.x/2 or spawnx > $Rocket.position.x + get_viewport_rect().size.x/2): - asteroid.position.y = rand_range($Rocket.position.y + get_viewport_rect().size.y/2, $Rocket.position.y - 2 * get_viewport_rect().size.y) + asteroid.position.y = rand_range($Rocket.position.y + get_viewport_rect().size.y / 10, $Rocket.position.y - get_viewport_rect().size.y) + print("Asteroid position outside of viewport: ", asteroid.position.x - $Rocket.position.x, ", ", asteroid.position.y - $Rocket.position.y) else: asteroid.position.y = rand_range($Rocket.position.y - get_viewport_rect().size.y, $Rocket.position.y - 2 * get_viewport_rect().size.y) #asteroid.position.x = rand_range($Rocket.position.x - get_viewport_rect().size.x/2, $Rocket.position.x + get_viewport_rect().size.x/2) diff --git a/Scripts/Rocket.gd b/Scripts/Rocket.gd index 2633880..27404ff 100644 --- a/Scripts/Rocket.gd +++ b/Scripts/Rocket.gd @@ -6,7 +6,7 @@ var deltaDifficulty = 0 var explosionObj = load("res://Objects/Explosion.tscn") var collided = false var isScreenPressed = false -var screenPressLocation = get_viewport().get_rect().size/2 +onready var screenPressLocation = get_viewport().size/2 var lastscore onready var gameNode = get_node("/root/Game") @@ -36,19 +36,25 @@ func _process(delta): queue_free() get_tree().change_scene("res://Game Scenes/Main Menu.tscn") if isScreenPressed: - print (true); + print (true) if (screenPressLocation <= get_viewport_rect().size.x/2): if angle > -1.5: - rotate(-0.05) - angle -= 0.05 + turn_left(0.05) elif (screenPressLocation > get_viewport_rect().size.x/2): if angle < 1.5: - rotate(0.05) - angle += 0.05 + turn_right(0.05) else: rotate(-angle/25) angle -= angle/25 +func turn_right(multiplier): + rotate(multiplier) + angle += multiplier + +func turn_left(multiplier): + rotate(multiplier * -1) + angle -= multiplier + func _input(event): if event is InputEventScreenTouch: if event.pressed == true: @@ -56,3 +62,8 @@ func _input(event): screenPressLocation = event.position.x if event.pressed == false: isScreenPressed = false + elif event is InputEventKey: + if event.pressed and event.scancode == KEY_LEFT: + turn_left(0.5) + elif event.pressed and event.scancode == KEY_RIGHT: + turn_right(0.5) diff --git a/Scripts/Text Container.gd b/Scripts/Text Container.gd index f2eae99..469e6f3 100644 --- a/Scripts/Text Container.gd +++ b/Scripts/Text Container.gd @@ -10,3 +10,6 @@ func _input(event): if event is InputEventScreenTouch: if event.pressed == true: get_tree().change_scene("res://Game Scenes/Game.tscn") + elif event is InputEventKey: + if event.pressed and event.scancode == KEY_SPACE: + get_tree().change_scene("res://Game Scenes/Game.tscn") diff --git a/export_presets.cfg b/export_presets.cfg index a940846..7935ab5 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -179,7 +179,7 @@ application/info="Made with Godot Engine" application/identifier="com.ADAwesomeGames.AsterVoid" application/signature="" application/short_version="2.0" -application/version="2.9" +application/version="2.11" application/copyright="2021 AD Awesome Games" capabilities/access_wifi=false capabilities/push_notifications=false