generated from hertog/godot-module-template
ignore this commit naming because it isn't real and cannot hurt you
This commit is contained in:
parent
4da7e28cb5
commit
e7cf1d3b95
19 changed files with 547 additions and 416 deletions
1
project/player/bullet.gd.uid
Normal file
1
project/player/bullet.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c1urgusujdgrc
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://dlfwkokoudcwv"]
|
||||
|
||||
[ext_resource type="Script" path="res://player/bullet.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://c1urgusujdgrc" path="res://player/bullet.gd" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://7sv64orewgmb" path="res://player/bullet.png" id="2"]
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id="1"]
|
||||
|
|
@ -52,7 +52,7 @@ tracks/2/keys = {
|
|||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hkd2b"]
|
||||
_data = {
|
||||
"shutdown": SubResource("3")
|
||||
&"shutdown": SubResource("3")
|
||||
}
|
||||
|
||||
[node name="Bullet" type="RigidBody2D"]
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ var floor_h_velocity: float = 0.0
|
|||
var airborne_time: float = 1e20
|
||||
var shoot_time: float = 1e20
|
||||
|
||||
@export var player_number: int
|
||||
|
||||
@onready var sound_jump := $SoundJump as AudioStreamPlayer2D
|
||||
@onready var sound_shoot := $SoundShoot as AudioStreamPlayer2D
|
||||
@onready var sprite := $Sprite2D as Sprite2D
|
||||
|
|
@ -41,14 +43,10 @@ func _integrate_forces(state: PhysicsDirectBodyState2D) -> void:
|
|||
var new_siding_left := siding_left
|
||||
|
||||
# Get player input.
|
||||
var move_left := Input.is_action_pressed(&"move_left")
|
||||
var move_right := Input.is_action_pressed(&"move_right")
|
||||
var jump := Input.is_action_pressed(&"jump")
|
||||
var shoot := Input.is_action_pressed(&"shoot")
|
||||
var spawn := Input.is_action_just_pressed(&"spawn")
|
||||
|
||||
if spawn:
|
||||
_spawn_enemy_above.call_deferred()
|
||||
var move_left := Input.is_action_pressed(&"move_left_%d" % player_number)
|
||||
var move_right := Input.is_action_pressed(&"move_right_%d" % player_number)
|
||||
var jump := Input.is_action_pressed(&"jump_%d" % player_number)
|
||||
var shoot := Input.is_action_pressed(&"shoot_%d" % player_number)
|
||||
|
||||
# Deapply prev floor velocity.
|
||||
velocity.x -= floor_h_velocity
|
||||
|
|
|
|||
1
project/player/player.gd.uid
Normal file
1
project/player/player.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://v2qm1uhymhi1
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=20 format=3 uid="uid://bbxsp4gp554vh"]
|
||||
|
||||
[ext_resource type="Script" path="res://player/player.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://v2qm1uhymhi1" path="res://player/player.gd" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://dh57uloeigwj6" path="res://player/player.webp" id="2_675nc"]
|
||||
[ext_resource type="Texture2D" uid="uid://7sv64orewgmb" path="res://player/bullet.png" id="3"]
|
||||
[ext_resource type="AudioStream" uid="uid://gw2a4ii0oby2" path="res://audio/sound_shoot.wav" id="8"]
|
||||
|
|
@ -178,16 +178,16 @@ tracks/0/keys = {
|
|||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_30623"]
|
||||
_data = {
|
||||
"crouch": SubResource("3"),
|
||||
"falling": SubResource("4"),
|
||||
"falling_weapon": SubResource("5"),
|
||||
"idle": SubResource("6"),
|
||||
"idle_weapon": SubResource("7"),
|
||||
"jumping": SubResource("8"),
|
||||
"jumping_weapon": SubResource("9"),
|
||||
"run": SubResource("10"),
|
||||
"run_weapon": SubResource("11"),
|
||||
"standing_weapon_ready": SubResource("12")
|
||||
&"crouch": SubResource("3"),
|
||||
&"falling": SubResource("4"),
|
||||
&"falling_weapon": SubResource("5"),
|
||||
&"idle": SubResource("6"),
|
||||
&"idle_weapon": SubResource("7"),
|
||||
&"jumping": SubResource("8"),
|
||||
&"jumping_weapon": SubResource("9"),
|
||||
&"run": SubResource("10"),
|
||||
&"run_weapon": SubResource("11"),
|
||||
&"standing_weapon_ready": SubResource("12")
|
||||
}
|
||||
|
||||
[sub_resource type="SeparationRayShape2D" id="13"]
|
||||
|
|
@ -199,8 +199,8 @@ mass = 1.5
|
|||
physics_material_override = SubResource("1")
|
||||
lock_rotation = true
|
||||
custom_integrator = true
|
||||
max_contacts_reported = 4
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
|
|
@ -214,24 +214,19 @@ self_modulate = Color(1, 1, 1, 0.26702)
|
|||
position = Vector2(10, 1.5)
|
||||
rotation = -1.45648
|
||||
emitting = false
|
||||
texture = ExtResource("3")
|
||||
lifetime = 0.3
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
texture = ExtResource("3")
|
||||
spread = 65.84
|
||||
gravity = Vector2(0, -15)
|
||||
color_ramp = SubResource("2")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_30623")
|
||||
&"": SubResource("AnimationLibrary_30623")
|
||||
}
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
zoom = Vector2(2, 2)
|
||||
limit_left = 0
|
||||
limit_top = 0
|
||||
|
||||
[node name="BulletShoot" type="Marker2D" parent="."]
|
||||
position = Vector2(15, 2)
|
||||
|
||||
|
|
|
|||
8
project/player/windowed_player.tscn
Normal file
8
project/player/windowed_player.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://4dckerlybom4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbboxhq703t1l" path="res://window.gd" id="1_j7b7i"]
|
||||
|
||||
[node name="Window" type="Window"]
|
||||
auto_translate_mode = 1
|
||||
position = Vector2i(0, 36)
|
||||
script = ExtResource("1_j7b7i")
|
||||
Loading…
Add table
Add a link
Reference in a new issue