Skip to content

Commit

Permalink
bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Piepkorn committed Oct 2, 2022
1 parent 26f3aac commit 1b4c53f
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 9 deletions.
30 changes: 30 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,33 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.1]

name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../ludum51.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/architecture="x86_64"
28 changes: 28 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,68 @@ move_forward={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
]
}
move_back={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
]
}
fire={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"pressed":false,"double_click":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null)
]
}
steer_left={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null)
]
}
steer_right={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null)
]
}
steer_up={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
]
}
steer_down={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
]
}

Expand Down
10 changes: 5 additions & 5 deletions scenes/blackHole/black_hole.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ signal hit
@export var explosionScene: PackedScene

const MAX_HEALTH = 250
const MIN_SCALE_DIST = 60
const MAX_SCALE_DIST = 30
const REVEAL_DIST = 25
const FULL_REVEAL_DIST = 15
const MIN_SCALE_DIST = 80
const MAX_SCALE_DIST = 40
const REVEAL_DIST = 40
const FULL_REVEAL_DIST = 25

var health = MAX_HEALTH

Expand Down Expand Up @@ -36,7 +36,7 @@ func _process(delta):
else:
$ColorRect.visible = false

func _on_hit(damage: float, cause: RigidBody3D):
func _on_hit(damage: float, cause: Node3D):
print("hit", health)
var player = get_node_or_null("/root/Root/Player") as RigidBody3D
var distToPlayer = (cause.global_transform.origin - global_transform.origin).length()
Expand Down
1 change: 1 addition & 0 deletions scenes/blackHole/black_hole.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ offset_right = 227.0
offset_bottom = 382.0

[node name="StaticBody3d" type="StaticBody3D" parent="."]
transform = Transform3D(2.001, 0, 0, 0, 2.001, 0, 0, 0, 2.001, 0, 0, 0)
script = ExtResource("3_cwcjd")

[node name="CollisionShape3d" type="CollisionShape3D" parent="StaticBody3d"]
Expand Down
2 changes: 1 addition & 1 deletion scenes/enemy/Enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func _physics_process(delta):
for weapon in get_node("Weapons").get_children():
weapon.fire()

func _on_hit(damage: float, cause: RigidBody3D):
func _on_hit(damage: float, cause: Node3D):
$HitSound.play()
health -= damage
if health <= 0:
Expand Down
4 changes: 4 additions & 0 deletions scenes/menu/death.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ extends Control

# Called when the node enters the scene tree for the first time.
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
pass # Replace with function body.

func _input(event):
if event.is_action_pressed("fire") || event.is_action_pressed("ui_select"):
_on_try_again_button_pressed()

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Expand Down
3 changes: 3 additions & 0 deletions scenes/menu/death.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ grow_vertical = 2
script = ExtResource("1_bh7aj")

[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
Expand All @@ -22,6 +23,7 @@ texture = ExtResource("1_ltxh5")
ignore_texture_size = true

[node name="RichTextLabel" type="RichTextLabel" parent="TextureRect"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
Expand All @@ -43,6 +45,7 @@ Unknown sensor echoes have been detected approaching earth.
[/center]"

[node name="TryAgainButton" type="Button" parent="TextureRect"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
Expand Down
1 change: 1 addition & 0 deletions scenes/menu/victory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Control

# Called when the node enters the scene tree for the first time.
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
pass # Replace with function body.


Expand Down
3 changes: 3 additions & 0 deletions scenes/menu/welcome.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var tmp5 = preload("res://scenes/explosion/Explosion.tscn")
func _ready():
pass # Replace with function body.

func _input(event):
if event.is_action_pressed("fire") || event.is_action_pressed("ui_select"):
_on_start_button_pressed()

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Expand Down
9 changes: 7 additions & 2 deletions scripts/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ signal hit

# Converts mouse movement (pixels) to rotation (radians).
const MOUSE_SENSITIVITY = 0.03
const CONTROLLER_SENSITIVITY = 1

const THRUST_FORWARD = 6
const THRUST_BACK = 0.2
const THRUST_SIDE = 1
const MAX_HEALTH = 200
const SHOCKWAVE_IMPULSE = 1;
const SHOCKWAVE_IMPULSE = 0.3;

var health = MAX_HEALTH

Expand All @@ -36,6 +37,7 @@ func _input(event):

if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
constant_torque = global_transform.basis * Vector3( -event.relative.y * MOUSE_SENSITIVITY, -event.relative.x * MOUSE_SENSITIVITY, 0)


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Expand All @@ -46,13 +48,16 @@ func _physics_process(delta):
var movement = Input.get_vector("move_left", "move_right", "move_back", "move_forward")
var upDown = Input.get_axis("move_down", "move_up")
apply_central_force(global_transform.basis * Vector3(movement.x * THRUST_SIDE, upDown * THRUST_SIDE, -THRUST_FORWARD*movement.y if movement.y > 0 else THRUST_BACK*movement.y))
if Input.get_connected_joypads().size() > 0:
var steer = Input.get_vector("steer_left", "steer_right", "steer_up", "steer_down")
constant_torque = global_transform.basis * Vector3(-steer.y * CONTROLLER_SENSITIVITY, -steer.x * CONTROLLER_SENSITIVITY, 0)

#func _integrate_forces(state):
# var localAngular = angular_velocity * global_transform.basis
# print(localAngular.z)
# angular_velocity = global_transform.basis * Vector3(localAngular.x, localAngular.y, localAngular.z * 0.9)

func _on_hit(damage: float, cause: RigidBody3D):
func _on_hit(damage: float, cause: Node3D):
get_node("Camera").shake(damage/MAX_HEALTH)
$HitSound.play()
health -= damage
Expand Down
3 changes: 2 additions & 1 deletion scripts/Spawner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func on_start_spawn():

func _on_timer_timeout():
var enemyCount = get_tree().get_nodes_in_group("enemies").size()
if enemyCount > MAX_COUNT:
var anomalyCount = get_tree().get_nodes_in_group("anomalies").size()
if enemyCount > MAX_COUNT || anomalyCount == 0:
return
var enemy = enemyScene.instantiate() as Node3D
var spawnpoint = Helpers.random_point_in_area(self)
Expand Down

0 comments on commit 1b4c53f

Please sign in to comment.