diff --git a/MB_FYP/assets/Fonts/Kenney Blocks.ttf b/MB_FYP/assets/Fonts/Kenney Blocks.ttf new file mode 100644 index 0000000..e26959f Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Blocks.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Blocks.ttf.import b/MB_FYP/assets/Fonts/Kenney Blocks.ttf.import new file mode 100644 index 0000000..111cd09 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Blocks.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://ounnadoh8cse" +path="res://.godot/imported/Kenney Blocks.ttf-64632e973be3cbbb5de78d891890ee05.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Blocks.ttf" +dest_files=["res://.godot/imported/Kenney Blocks.ttf-64632e973be3cbbb5de78d891890ee05.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf b/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf new file mode 100644 index 0000000..42f2c33 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf.import b/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf.import new file mode 100644 index 0000000..3e0009e --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Future Narrow.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dtpvg4lmre10g" +path="res://.godot/imported/Kenney Future Narrow.ttf-301df4fdb0f9e9f2e07ce3c0f461dccd.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Future Narrow.ttf" +dest_files=["res://.godot/imported/Kenney Future Narrow.ttf-301df4fdb0f9e9f2e07ce3c0f461dccd.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Future.ttf b/MB_FYP/assets/Fonts/Kenney Future.ttf new file mode 100644 index 0000000..1dbb2dd Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Future.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Future.ttf.import b/MB_FYP/assets/Fonts/Kenney Future.ttf.import new file mode 100644 index 0000000..c7e1936 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Future.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://vfataagjvmy0" +path="res://.godot/imported/Kenney Future.ttf-d046583541bdf2b4d8304d362a680449.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Future.ttf" +dest_files=["res://.godot/imported/Kenney Future.ttf-d046583541bdf2b4d8304d362a680449.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney High Square.ttf b/MB_FYP/assets/Fonts/Kenney High Square.ttf new file mode 100644 index 0000000..cef588d Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney High Square.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney High Square.ttf.import b/MB_FYP/assets/Fonts/Kenney High Square.ttf.import new file mode 100644 index 0000000..0a4b5c7 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney High Square.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://csc0mglr25e78" +path="res://.godot/imported/Kenney High Square.ttf-31cf241a9e4b08ed1ede4c4ece8b8295.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney High Square.ttf" +dest_files=["res://.godot/imported/Kenney High Square.ttf-31cf241a9e4b08ed1ede4c4ece8b8295.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney High.ttf b/MB_FYP/assets/Fonts/Kenney High.ttf new file mode 100644 index 0000000..14f8b14 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney High.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney High.ttf.import b/MB_FYP/assets/Fonts/Kenney High.ttf.import new file mode 100644 index 0000000..489ee4e --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney High.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cwotp0tbjqvt8" +path="res://.godot/imported/Kenney High.ttf-e1cffc8feca349e3b2468c63a8225519.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney High.ttf" +dest_files=["res://.godot/imported/Kenney High.ttf-e1cffc8feca349e3b2468c63a8225519.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf b/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf new file mode 100644 index 0000000..33c1fd6 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf.import b/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf.import new file mode 100644 index 0000000..993767a --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Mini Square Mono.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://ck7kkvo78s2fu" +path="res://.godot/imported/Kenney Mini Square Mono.ttf-af2d7d93b948dc0c2735b6cdee649336.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Mini Square Mono.ttf" +dest_files=["res://.godot/imported/Kenney Mini Square Mono.ttf-af2d7d93b948dc0c2735b6cdee649336.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Mini Square.ttf b/MB_FYP/assets/Fonts/Kenney Mini Square.ttf new file mode 100644 index 0000000..5f2c5bb Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Mini Square.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Mini Square.ttf.import b/MB_FYP/assets/Fonts/Kenney Mini Square.ttf.import new file mode 100644 index 0000000..2018d57 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Mini Square.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://ryhimaxr7tr4" +path="res://.godot/imported/Kenney Mini Square.ttf-c49f8ef1e49f69b3f8da5d1786aa5f74.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Mini Square.ttf" +dest_files=["res://.godot/imported/Kenney Mini Square.ttf-c49f8ef1e49f69b3f8da5d1786aa5f74.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Mini.ttf b/MB_FYP/assets/Fonts/Kenney Mini.ttf new file mode 100644 index 0000000..5cbfd37 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Mini.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Mini.ttf.import b/MB_FYP/assets/Fonts/Kenney Mini.ttf.import new file mode 100644 index 0000000..b9aaeef --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Mini.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bwff4j1ko8iw" +path="res://.godot/imported/Kenney Mini.ttf-f6e816f8968c0ca76db18efbb448ca70.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Mini.ttf" +dest_files=["res://.godot/imported/Kenney Mini.ttf-f6e816f8968c0ca76db18efbb448ca70.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf b/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf new file mode 100644 index 0000000..e540208 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf.import b/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf.import new file mode 100644 index 0000000..9110fa8 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Pixel Square.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://be6xxaq8drt5q" +path="res://.godot/imported/Kenney Pixel Square.ttf-87d12b7133dcb0cab032f3d23f9126b0.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Pixel Square.ttf" +dest_files=["res://.godot/imported/Kenney Pixel Square.ttf-87d12b7133dcb0cab032f3d23f9126b0.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Pixel.ttf b/MB_FYP/assets/Fonts/Kenney Pixel.ttf new file mode 100644 index 0000000..e6978d7 Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Pixel.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Pixel.ttf.import b/MB_FYP/assets/Fonts/Kenney Pixel.ttf.import new file mode 100644 index 0000000..700b3e6 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Pixel.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://csh34n3rsgqc7" +path="res://.godot/imported/Kenney Pixel.ttf-bfeee1b80514f0a82a1024eba2c5fa2a.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Pixel.ttf" +dest_files=["res://.godot/imported/Kenney Pixel.ttf-bfeee1b80514f0a82a1024eba2c5fa2a.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf b/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf new file mode 100644 index 0000000..ca788bb Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf.import b/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf.import new file mode 100644 index 0000000..b612cb3 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Rocket Square.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c4adhqwiyrh1h" +path="res://.godot/imported/Kenney Rocket Square.ttf-dbb5f3f57e75b91a3303c7bab51670de.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Rocket Square.ttf" +dest_files=["res://.godot/imported/Kenney Rocket Square.ttf-dbb5f3f57e75b91a3303c7bab51670de.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/assets/Fonts/Kenney Rocket.ttf b/MB_FYP/assets/Fonts/Kenney Rocket.ttf new file mode 100644 index 0000000..ea53b8c Binary files /dev/null and b/MB_FYP/assets/Fonts/Kenney Rocket.ttf differ diff --git a/MB_FYP/assets/Fonts/Kenney Rocket.ttf.import b/MB_FYP/assets/Fonts/Kenney Rocket.ttf.import new file mode 100644 index 0000000..65fa7e7 --- /dev/null +++ b/MB_FYP/assets/Fonts/Kenney Rocket.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b7n886qnywthr" +path="res://.godot/imported/Kenney Rocket.ttf-068c6fea1b9afcff4c5cbda5ba66e00d.fontdata" + +[deps] + +source_file="res://assets/Fonts/Kenney Rocket.ttf" +dest_files=["res://.godot/imported/Kenney Rocket.ttf-068c6fea1b9afcff4c5cbda5ba66e00d.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/MB_FYP/scenes/game.tscn b/MB_FYP/scenes/game.tscn index 5cc409c..5ddfa8f 100644 --- a/MB_FYP/scenes/game.tscn +++ b/MB_FYP/scenes/game.tscn @@ -1,15 +1,21 @@ -[gd_scene load_steps=4 format=3 uid="uid://635xs5haibcn"] +[gd_scene load_steps=5 format=3 uid="uid://635xs5haibcn"] [ext_resource type="PackedScene" uid="uid://ckh362yqjkpi0" path="res://scenes/player.tscn" id="1_1w06w"] [ext_resource type="Script" path="res://script/game.cs" id="1_dukjm"] +[ext_resource type="PackedScene" uid="uid://b6myj160l6vf8" path="res://scenes/hud.tscn" id="2_xbhg5"] [ext_resource type="PackedScene" uid="uid://dnvcics1ni4pa" path="res://scenes/asteroid.tscn" id="3_b8wlr"] [node name="Game" type="Node2D"] script = ExtResource("1_dukjm") +[node name="UI" type="CanvasLayer" parent="."] + +[node name="HUD" parent="UI" instance=ExtResource("2_xbhg5")] + [node name="Player" parent="." instance=ExtResource("1_1w06w")] position = Vector2(800, 450) scale = Vector2(0.6, 0.6) +collision_layer = 8 [node name="Lasers" type="Node" parent="."] diff --git a/MB_FYP/scenes/hud.tscn b/MB_FYP/scenes/hud.tscn new file mode 100644 index 0000000..48596c8 --- /dev/null +++ b/MB_FYP/scenes/hud.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=4 format=3 uid="uid://b6myj160l6vf8"] + +[ext_resource type="Script" path="res://script/hud.cs" id="1_aksh1"] +[ext_resource type="FontFile" uid="uid://be6xxaq8drt5q" path="res://assets/Fonts/Kenney Pixel Square.ttf" id="2_2d36h"] + +[sub_resource type="LabelSettings" id="LabelSettings_588nb"] +font = ExtResource("2_2d36h") +font_size = 48 + +[node name="HUD" type="Control"] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("1_aksh1") + +[node name="Score" type="Label" parent="."] +layout_mode = 0 +offset_left = 15.0 +offset_top = 15.0 +offset_right = 363.0 +offset_bottom = 90.0 +text = "SCORE: 9999" +label_settings = SubResource("LabelSettings_588nb") diff --git a/MB_FYP/script/game.cs b/MB_FYP/script/game.cs index d44b1fd..67e7d11 100644 --- a/MB_FYP/script/game.cs +++ b/MB_FYP/script/game.cs @@ -7,10 +7,23 @@ public partial class game : Node2D public CharacterBody2D Player = null; public Node Asteroids = null; + public Control HUD = null; + + public Label ScoreLabel = null; + + public hud h; + + private readonly PackedScene AsteroidScene = GD.Load("res://scenes/asteroid.tscn"); + public int Score = 0; + public override void _Ready() { + HUD = GetNode("UI/HUD"); + ScoreLabel = GetNode