diff --git a/fonts/license.txt b/fonts/license.txt new file mode 100644 index 0000000..d78a38d --- /dev/null +++ b/fonts/license.txt @@ -0,0 +1,94 @@ +Copyright (c) 2011 Juan Montoreano (juan@remolacha.biz), +with Reserved Font Name Lilita + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/lilita_one_regular.ttf b/fonts/lilita_one_regular.ttf new file mode 100644 index 0000000..091ddf9 Binary files /dev/null and b/fonts/lilita_one_regular.ttf differ diff --git a/fonts/lilita_one_regular.ttf.import b/fonts/lilita_one_regular.ttf.import new file mode 100644 index 0000000..28ca0fe --- /dev/null +++ b/fonts/lilita_one_regular.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://biqtga8moh7ah" +path="res://.godot/imported/lilita_one_regular.ttf-68cc4ab6825bdd499d1ad608190f5213.fontdata" + +[deps] + +source_file="res://fonts/lilita_one_regular.ttf" +dest_files=["res://.godot/imported/lilita_one_regular.ttf-68cc4ab6825bdd499d1ad608190f5213.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/models/blaster.glb b/models/blaster.glb index b8ab176..3ef3a82 100644 Binary files a/models/blaster.glb and b/models/blaster.glb differ diff --git a/objects/enemy.gd b/objects/enemy.gd index 0321716..dac11b6 100644 --- a/objects/enemy.gd +++ b/objects/enemy.gd @@ -56,3 +56,5 @@ func shoot(): burst_b.rotation_degrees.z = randf_range(-45, 45) Audio.play("sounds/enemy_attack.ogg") + + collider.get_hurt() diff --git a/objects/player.gd b/objects/player.gd index 19f7d30..f86bdf3 100644 --- a/objects/player.gd +++ b/objects/player.gd @@ -133,10 +133,10 @@ func handle_controls(delta): var rotation_input := Vector3.ZERO - input.y = Input.get_axis("camera_left", "camera_right") - input.x = Input.get_axis("camera_up", "camera_down") / 2 + rotation_input.y = Input.get_axis("camera_left", "camera_right") + rotation_input.x = Input.get_axis("camera_up", "camera_down") / 2 - rotation_target -= input.limit_length(1.0) * 5 * delta + rotation_target -= rotation_input.limit_length(1.0) * 5 * delta rotation_target.x = clamp(rotation_target.x, deg_to_rad(-90), deg_to_rad(90)) #input_mouse = Vector2.ZERO @@ -195,13 +195,16 @@ func action_shoot(): container.position.z += 0.25 burst.play("default") + burst.rotation_degrees.z = randf_range(-45, 45) burst.scale = Vector3.ONE * randf_range(0.40, 0.75) - burst.position = container.position - Vector3(0.1, -0.4, 1.5) + camera.rotation.x += 0.025 blaster_cooldown.start(weapon.cooldown) + movement_velocity += Vector3(0, 0, weapon.knockback) + # What or where the blaster hit for n in weapon.shot_count: diff --git a/scenes/main.tscn b/scenes/main.tscn index d03366d..07f6569 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -1,13 +1,20 @@ -[gd_scene load_steps=8 format=3 uid="uid://dxvvlck8lej3f"] +[gd_scene load_steps=10 format=3 uid="uid://dxvvlck8lej3f"] [ext_resource type="Environment" uid="uid://jvmpkdwaeaq" path="res://scenes/main-environment.tres" id="1_q8fpv"] [ext_resource type="PackedScene" uid="uid://dl2ed4gkybggf" path="res://objects/player.tscn" id="2_elriq"] +[ext_resource type="FontFile" uid="uid://biqtga8moh7ah" path="res://fonts/lilita_one_regular.ttf" id="3_w27de"] [ext_resource type="PackedScene" uid="uid://dpm3l05d7fu35" path="res://objects/platform.tscn" id="5_3s40e"] [ext_resource type="PackedScene" uid="uid://r7rt7pth4u7o" path="res://objects/wall_low.tscn" id="5_6vel1"] [ext_resource type="PackedScene" uid="uid://c71evdjblk5wp" path="res://objects/wall_high.tscn" id="7_cabne"] [ext_resource type="PackedScene" uid="uid://bvx5cvigosg0s" path="res://objects/platform_large_grass.tscn" id="7_wggef"] [ext_resource type="PackedScene" uid="uid://d2g78tpqbyf5g" path="res://objects/enemy.tscn" id="8_7ty2f"] +[sub_resource type="LabelSettings" id="LabelSettings_fpmwk"] +font = ExtResource("3_w27de") +font_size = 36 +outline_size = 12 +outline_color = Color(0, 0, 0, 0.470588) + [node name="Main" type="Node3D"] [node name="WorldEnvironment" type="WorldEnvironment" parent="."] @@ -38,6 +45,25 @@ grow_vertical = 2 scale = Vector2(0.35, 0.35) pivot_offset = Vector2(64, 64) +[node name="MarginContainer" type="MarginContainer" parent="Canvas"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 48 +theme_override_constants/margin_top = 48 +theme_override_constants/margin_right = 48 +theme_override_constants/margin_bottom = 48 + +[node name="Health" type="Label" parent="Canvas/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 8 +text = "100%" +label_settings = SubResource("LabelSettings_fpmwk") +vertical_alignment = 2 + [node name="Enemies" type="Node" parent="."] [node name="enemy-flying" parent="Enemies" node_paths=PackedStringArray("player") instance=ExtResource("8_7ty2f")] diff --git a/scripts/weapon.gd b/scripts/weapon.gd index 317384e..c637815 100644 --- a/scripts/weapon.gd +++ b/scripts/weapon.gd @@ -13,6 +13,7 @@ class_name Weapon @export_range(0, 100) var damage: float = 25 # Damage per hit @export_range(0, 5) var spread: float = 0 # Spread of each shot @export_range(1, 5) var shot_count: int = 1 # Amount of shots +@export_range(0, 50) var knockback: int = 20 # Amount of knockback @export_subgroup("Sounds") @export var sound_shoot: String # Sound path diff --git a/sounds/blaster.ogg b/sounds/blaster.ogg index 16f881c..ff2a71e 100644 Binary files a/sounds/blaster.ogg and b/sounds/blaster.ogg differ diff --git a/sounds/blaster.ogg.import b/sounds/blaster.ogg.import index b2d70d8..d922369 100644 --- a/sounds/blaster.ogg.import +++ b/sounds/blaster.ogg.import @@ -2,7 +2,7 @@ importer="oggvorbisstr" type="AudioStreamOggVorbis" -uid="uid://w3hirmwndftn" +uid="uid://dkftljsbdhwng" path="res://.godot/imported/blaster.ogg-1527ec84d518b60bb9fbaad97656d870.oggvorbisstr" [deps] @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/blaster.ogg-1527ec84d518b60bb9fbaad97656d870. [params] loop=false -loop_offset=0.0 -bpm=0.0 +loop_offset=0 +bpm=0 beat_count=0 bar_beats=4 diff --git a/weapons/blaster-repeater.tres b/weapons/blaster-repeater.tres index 8d246a6..c6e7c02 100644 --- a/weapons/blaster-repeater.tres +++ b/weapons/blaster-repeater.tres @@ -15,5 +15,6 @@ max_distance = 10 damage = 10.0 spread = 0.5 shot_count = 1 +knockback = 10 sound_shoot = "sounds/blaster_repeater.ogg" crosshair = ExtResource("1_hoqei") diff --git a/weapons/blaster.tres b/weapons/blaster.tres index da7dc3c..e889e2e 100644 --- a/weapons/blaster.tres +++ b/weapons/blaster.tres @@ -10,10 +10,11 @@ model = ExtResource("1_x0glg") position = Vector3(0, 0, 0) rotation = Vector3(0, 180, 0) burst_position = Vector3(0, 0, 0) -cooldown = 0.5 +cooldown = 0.25 max_distance = 10 damage = 25.0 -spread = 2.0 +spread = 1.0 shot_count = 3 +knockback = 40 sound_shoot = "sounds/blaster.ogg" crosshair = ExtResource("1_2onsr")