diff --git a/fonts/Doto.ttf b/fonts/Doto.ttf new file mode 100644 index 0000000..5b4cf7d Binary files /dev/null and b/fonts/Doto.ttf differ diff --git a/fonts/Doto.ttf.import b/fonts/Doto.ttf.import new file mode 100644 index 0000000..aff03bc --- /dev/null +++ b/fonts/Doto.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://donsvh2l775rb" +path="res://.godot/imported/Doto.ttf-3228f40091ab5ffe98c98dbbab781835.fontdata" + +[deps] + +source_file="res://fonts/Doto.ttf" +dest_files=["res://.godot/imported/Doto.ttf-3228f40091ab5ffe98c98dbbab781835.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Michroma.ttf b/fonts/Michroma.ttf new file mode 100644 index 0000000..e2a7ceb Binary files /dev/null and b/fonts/Michroma.ttf differ diff --git a/fonts/Michroma.ttf.import b/fonts/Michroma.ttf.import new file mode 100644 index 0000000..4bd4eba --- /dev/null +++ b/fonts/Michroma.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://n1nd5m2kwexu" +path="res://.godot/imported/Michroma.ttf-f6ea4707f12da5f181eaf7929c9c9384.fontdata" + +[deps] + +source_file="res://fonts/Michroma.ttf" +dest_files=["res://.godot/imported/Michroma.ttf-f6ea4707f12da5f181eaf7929c9c9384.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/project.godot b/project.godot index 3544db4..dcbee72 100644 --- a/project.godot +++ b/project.godot @@ -13,6 +13,7 @@ config_version=5 config/name="Super Space Game" run/main_scene="uid://bauklhpieuivd" config/features=PackedStringArray("4.5", "Mobile") +boot_splash/bg_color=Color(0, 0, 0, 1) config/icon="res://icon.svg" [display] @@ -25,6 +26,10 @@ window/stretch/scale_mode="integer" enabled=PackedStringArray("res://addons/godot_super-wakatime/plugin.cfg") +[gui] + +theme/custom_font="uid://n1nd5m2kwexu" + [input] turn_left={ diff --git a/scenes/asteroid.tscn b/scenes/asteroid.tscn new file mode 100644 index 0000000..a2ca58a --- /dev/null +++ b/scenes/asteroid.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=3 uid="uid://dgng5vdhn6anc"] + +[ext_resource type="Texture2D" uid="uid://co67k1hqadpv4" path="res://textures/asteroid_small.png" id="1_akfqu"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"] +radius = 16.0 + +[node name="Asteroid" type="RigidBody2D"] +mass = 2.5 +linear_damp = 4.0 + +[node name="Sprite" type="Sprite2D" parent="."] +texture = ExtResource("1_akfqu") + +[node name="CollisionShape" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_uwrxv") diff --git a/scenes/game.tscn b/scenes/game.tscn index a457254..5358ee8 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,11 +1,15 @@ -[gd_scene load_steps=4 format=3 uid="uid://bauklhpieuivd"] +[gd_scene load_steps=6 format=3 uid="uid://bauklhpieuivd"] [ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"] [ext_resource type="Script" uid="uid://bfxfkrkaebxk0" path="res://scripts/player.gd" id="1_yqjtg"] +[ext_resource type="PackedScene" uid="uid://dgng5vdhn6anc" path="res://scenes/asteroid.tscn" id="3_lnu2h"] [sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"] radius = 16.0 +[sub_resource type="CircleShape2D" id="CircleShape2D_lnu2h"] +radius = 20.0 + [node name="Game" type="Node2D"] [node name="Player" type="RigidBody2D" parent="."] @@ -15,7 +19,7 @@ script = ExtResource("1_yqjtg") [node name="Sprite" type="Sprite2D" parent="Player"] texture = ExtResource("1_uwrxv") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] +[node name="CollisionShape" type="CollisionShape2D" parent="Player"] shape = SubResource("CircleShape2D_uwrxv") [node name="Camera2D" type="Camera2D" parent="Player"] @@ -25,4 +29,20 @@ position_smoothing_speed = 8.0 rotation_smoothing_enabled = true rotation_smoothing_speed = 15.0 -[node name="RigidBody2D" type="RigidBody2D" parent="."] +[node name="Hitbox" type="Area2D" parent="Player"] + +[node name="CollisionShape" type="CollisionShape2D" parent="Player/Hitbox"] +shape = SubResource("CircleShape2D_lnu2h") +debug_color = Color(0.9686392, 0, 0.4696517, 0.41960785) + +[node name="Asteroid" parent="." instance=ExtResource("3_lnu2h")] +position = Vector2(-42, -173) + +[node name="Asteroid2" parent="." instance=ExtResource("3_lnu2h")] +position = Vector2(227, 37) + +[node name="Asteroid3" parent="." instance=ExtResource("3_lnu2h")] +position = Vector2(-216, 134) + +[node name="Asteroid4" parent="." instance=ExtResource("3_lnu2h")] +position = Vector2(-192, -427) diff --git a/scripts/player.gd b/scripts/player.gd index 15dea78..b72e642 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -1,8 +1,9 @@ extends RigidBody2D var health = 1000 +var time_since_last_collision = 0 -func _process(delta: float) -> void: +func _physics_process(delta: float) -> void: var axis = Input.get_axis("turn_left", "turn_right") angular_velocity = deg_to_rad(180 * axis)