Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
c268ee7
added initial stuff
Pewweper Feb 22, 2025
4382236
dialogue box + talking options
Pewweper Feb 22, 2025
ca22e8b
Merge branch 'main' into 3d_adventure
Pewweper Feb 22, 2025
92d8b0b
added following units
Pewweper Feb 25, 2025
5fcbefd
new follower scene
Pewweper Feb 25, 2025
e8193cf
camera work
Pewweper Feb 28, 2025
356bb96
new meshes + updated ally logic
Pewweper Mar 1, 2025
e6b5e17
Merge branch 'main' into 3d_adventure
Pewweper Mar 1, 2025
350b414
scrap collection mechanic added
Pewweper Mar 2, 2025
a8c2583
added damaging and being damaged
Pewweper Mar 6, 2025
4d45208
Overworld + ally rework + dungeon
Pewweper Mar 8, 2025
af7ff9e
enemies added
Pewweper Mar 10, 2025
c6d4b35
A few minor changes
DragonfallGames Mar 10, 2025
03d0c5a
Small Camera Improvements
DragonfallGames Mar 11, 2025
aa972d5
Improved player walking look direction
DragonfallGames Mar 11, 2025
a39bb7d
player input not rotated - fixed
DragonfallGames Mar 11, 2025
a22f23a
survival mode
Pewweper Mar 12, 2025
c987c41
working survival mode
Pewweper Mar 13, 2025
fa5e4f9
added_enemies
Pewweper Mar 13, 2025
4776502
added shooter into the game
Pewweper Mar 15, 2025
ca0baca
added instruction for shooter
Pewweper Mar 15, 2025
3da1675
WIP Unit Throwing
DragonfallGames Mar 16, 2025
14c65a3
made player jump higher
Pewweper Mar 16, 2025
191714e
Added Unit Throwing Types
DragonfallGames Mar 17, 2025
1f6542f
first level + fixed allies
Pewweper Mar 17, 2025
64671ae
level_1 update + enemy_logic + ally_collecting
Pewweper Mar 19, 2025
b6868da
minor unit logic fixes
Pewweper Mar 19, 2025
90b7dbe
level 1 complete(kinda)
Pewweper Mar 19, 2025
df00dc9
Level 2 also workshop added
Pewweper Mar 21, 2025
97aff33
added blueprints
Pewweper Mar 21, 2025
8e19f21
Reverted Unit Broken Functionality
DragonfallGames Mar 22, 2025
88168e1
Added Unit Recall Mechanics
DragonfallGames Mar 22, 2025
96fc32f
Unit Attack Logic
DragonfallGames Mar 23, 2025
99861a8
quick clean
DragonfallGames Mar 23, 2025
95dc41d
surival mode update
Pewweper Mar 23, 2025
1822611
added level 3 AND an a new addon
Pewweper Mar 24, 2025
e2fe150
level 3 update
Pewweper Mar 25, 2025
c1e3dfb
multiplayer testing
Pewweper Mar 25, 2025
70b8eb5
level 3 and multiplayer minor update
Pewweper Mar 25, 2025
9348ea9
multiplayer fixes: part 2
Pewweper Mar 26, 2025
c61f703
Unit Scrap Collection
DragonfallGames Mar 28, 2025
1e118b7
player camera and ui fix, new boss added
Pewweper Mar 28, 2025
519a45c
multiplayer fixes
Pewweper Mar 28, 2025
b686c1e
shielder enemy and multiplayer stuff
Pewweper Mar 29, 2025
db38605
new mining rig building
Pewweper Mar 31, 2025
406ebad
new waves and new medic enemy
Pewweper Mar 31, 2025
7f0fb5b
more waves
Pewweper Apr 1, 2025
814aa2e
heal_func for enemies, new upgrade, pausing.
Pewweper Apr 2, 2025
6447865
unit throw limit
Pewweper Apr 3, 2025
0aa9497
small fixes, new mode on survival
Pewweper Apr 4, 2025
eb58f8f
adding "endless" to survival mode
Pewweper Apr 4, 2025
c96fc75
returned sound to music
Pewweper Apr 4, 2025
8da953f
Refactor Progress Start
DragonfallGames Apr 7, 2025
709f063
multiple multiplayer fixes
Pewweper Apr 7, 2025
a2e9103
multiplayer fixes 1
Pewweper Apr 7, 2025
434cf43
multiplayer fixes 2
Pewweper Apr 7, 2025
d05bde4
multiplayer fixes 3
Pewweper Apr 7, 2025
2e55701
multiplayer fixes 4
Pewweper Apr 7, 2025
202b11d
Refactoring Progress
DragonfallGames Apr 8, 2025
d3ed862
Merge branch '3d_adventure' of https://github.com/RedotOpenGame/game …
DragonfallGames Apr 8, 2025
f90323b
Minor Quickfix
DragonfallGames Apr 8, 2025
f76773c
Multiplayer conveniences
Pewweper Apr 12, 2025
48996af
painted units and random names for multplr
Pewweper Apr 12, 2025
7d63982
Add files via upload
Quadratus873 Apr 12, 2025
b94e05a
mesh imported
Pewweper Apr 12, 2025
488c311
small changes, refactoring
Pewweper Apr 15, 2025
ba2a8c2
devtools at overworld, enemy fixes
Pewweper Apr 16, 2025
85a4f2b
QoL changes
Pewweper Apr 18, 2025
07972bc
optimizations mostly regarding units
Pewweper Apr 19, 2025
10f7be0
added boombox
Pewweper Apr 20, 2025
254da12
mortar and balance change
Pewweper Apr 21, 2025
8e06cdf
QoL stuff and bug fixes
Pewweper Apr 23, 2025
64ae60c
new music for survival
Pewweper Apr 23, 2025
2556992
new enemy tier and wave autoskip
Pewweper Apr 27, 2025
01ec2d0
unit collection showing
Pewweper Apr 29, 2025
d47c929
new ui + new font
Pewweper Apr 29, 2025
ebb53e1
blueprint placement rework
Pewweper Apr 30, 2025
a327fe0
small fixes
Pewweper May 6, 2025
fec4c03
added unit factory
Pewweper May 7, 2025
72e12c5
new attachment
Pewweper May 8, 2025
e6899a7
new turret
Pewweper May 11, 2025
14a84c7
more feature bloat
Pewweper May 12, 2025
d6266bb
level 3 update
Pewweper May 14, 2025
1b9ce10
new level + tutorial finished
Pewweper May 14, 2025
f384da3
first level done
Pewweper May 16, 2025
e4cd72e
Level 2 complete
Pewweper May 18, 2025
f538eda
LEVEL 3
Pewweper May 19, 2025
b38e03d
level 4 W.I.P.
Pewweper May 20, 2025
8a3daa2
new room in level 4
Pewweper May 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@

# Redot 4+ specific ignores
.godot/
/android/

8 changes: 8 additions & 0 deletions Globals/Gameplay.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

var scrap:int = 0
var paused:bool = false

@rpc("any_peer", "call_local")
func plus_scrap(amount) -> void:
scrap += amount
14 changes: 14 additions & 0 deletions Globals/Gameplay.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://shs18agwtmty"]

[ext_resource type="Script" path="res://Globals/Gameplay.gd" id="1_cpaa0"]

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_2pwaf"]
properties/0/path = NodePath(".:scrap")
properties/0/spawn = true
properties/0/replication_mode = 1

[node name="Gameplay" type="Node"]
script = ExtResource("1_cpaa0")

[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_2pwaf")
8 changes: 8 additions & 0 deletions Globals/MultiplayerHelper.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

var Players = {}


var IPAddress:String = "127.0.0.1"
var Port:int = 8910
var Nickname:String = "Pewweper"
39 changes: 39 additions & 0 deletions Globals/SaveSystem.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
extends Node

const MULTIPLAYER_PREF_NAME = "user://multiplayer_settings.json"

func save_mult_pref():
var contents = {
"Address":MultiplayerHelper.IPAddress,
"Port":MultiplayerHelper.Port,
"Nickname":MultiplayerHelper.Nickname
}
var json_string = JSON.stringify(contents)
var file_access := FileAccess.open(MULTIPLAYER_PREF_NAME, FileAccess.WRITE)
if not file_access:
print("An error happened while saving data: ", FileAccess.get_open_error())
return
file_access.store_line(json_string)
file_access.close()

func load_mult_pref():
if not FileAccess.file_exists(MULTIPLAYER_PREF_NAME):
return
var file_access := FileAccess.open(MULTIPLAYER_PREF_NAME, FileAccess.READ)
var json_string := file_access.get_line()
file_access.close()

var json := JSON.new()
var error := json.parse(json_string)
if error:
printerr("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
return
# We saved a dictionary, lets assume is a dictionary
var data:Dictionary = json.data

if data.get("Address") != null:
MultiplayerHelper.IPAddress = data.get("Address")
if data.get("Port") != null:
MultiplayerHelper.Port = data.get("Port")
if data.get("Nickname") != null:
MultiplayerHelper.Nickname = data.get("Nickname")
20 changes: 20 additions & 0 deletions Scenes/General/GeneralBuilding.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
extends GeneralEntity
class_name GeneralBuilding

var resource_pile = preload("res://Scenes/misc/resource_pile.tscn")
@export var dropped_scrap:int = 0

var player_id:int = 0
var player_name:String = "Pewweper"
var show_name:bool = false

func death() -> void:
var scene = resource_pile.instantiate()
scene.position = global_position
scene.scrap = dropped_scrap
add_sibling(scene)
queue_free()

@rpc("any_peer", "call_local")
func demolish() -> void:
death()
90 changes: 90 additions & 0 deletions Scenes/General/GeneralEntity.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
extends CharacterBody3D
#
# This is our primary class for characters in the game, mostly including functionality for handling damage in combat scenarios
# Handling autonomous targeting and movement, as well as other combat things.
# Not every subclass will necessarily use every function but this will generally have things that are nice to have on entities.
#

class_name GeneralEntity

@export var max_health:float = 100.0
@onready var health:float = max_health
@onready var curr_scrap:int = 0
@export var max_scrap:int = 3

func damage_func(amount:float) -> void:
health -= amount
if health <= 0:
death()

func heal_func(amount:float) -> void:
health = min(health + amount, max_health)

func death():
queue_free()

func find_closest_target(targetArea: Area3D, targetTag: String) -> CharacterBody3D:
var bodies = targetArea.get_overlapping_bodies()
#if bodies.is_empty():
#return null
var closest:float = INF

var current_position = global_position
var returnEntity = null
var importants = get_tree().get_nodes_in_group("Important") #like townhall for survival mode.
if !importants.is_empty():
for i in importants:
if i.is_in_group(targetTag) and current_position.distance_to(i.global_position) < closest:
returnEntity = i
closest = current_position.distance_to(i.global_position)
for body in bodies:
if body.is_in_group(targetTag) and current_position.distance_to(body.global_position) < closest:
returnEntity = body
closest = current_position.distance_to(body.global_position)
return returnEntity

func find_closest_target_that_isnt_self(targetArea: Area3D, targetTag: String) -> CharacterBody3D:
var bodies = targetArea.get_overlapping_bodies()
if self in bodies:
bodies.erase(self)
var closest:float = INF

var current_position = global_position
var returnEntity = null
var importants = get_tree().get_nodes_in_group("Important") #like townhall for survival mode.
if !importants.is_empty():
for i in importants:
if i.is_in_group(targetTag) and current_position.distance_to(i.global_position) < closest:
returnEntity = i
closest = current_position.distance_to(i.global_position)
for body in bodies:
if body.is_in_group(targetTag) and current_position.distance_to(body.global_position) < closest:
returnEntity = body
closest = current_position.distance_to(body.global_position)
return returnEntity

func find_closest_global_target(targetTag: String) -> GeneralEntity:
var bodies = get_tree().get_nodes_in_group(targetTag)
if bodies.is_empty():
return null
var returnEntity = bodies.front()
var current_position = global_position
for body in bodies:
if current_position.distance_to(body.global_position) < current_position.distance_to(returnEntity.global_position):
returnEntity = body
return returnEntity

func move_towards_target(targetPos: Vector3, speed: float):
var direction = (targetPos - global_position).normalized()
velocity.x = direction.x * speed
velocity.z = direction.z * speed

func rotate_towards_target(targetPos: Vector3, rotationNode: Node3D, lerpVal: float):
var direction = (targetPos - global_position).normalized()
if(rotationNode != null):
rotationNode.rotation.y = lerp_angle(rotationNode.rotation.y, atan2(-direction.x, -direction.z), lerpVal)

func get_scrap(amount) -> int:
var old_scrap = curr_scrap
curr_scrap = min(max_scrap, curr_scrap + amount)
return curr_scrap - old_scrap
19 changes: 19 additions & 0 deletions Scenes/Levels/block_holder.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends CharacterBody3D


@onready var health_label: Label3D = $HealthLabel
var health = 32

func _ready() -> void:
health_label.text = str("Health: ", health)

func damage_func(amount:float) -> void:

health -= amount
health_label.text = str("Health: ", health)
if health <= 0:
death()

func death():
get_parent().get_parent().get_parent().make_the_block_fall()
queue_free()
21 changes: 21 additions & 0 deletions Scenes/Levels/block_holder_other.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends CharacterBody3D

signal block_dead
signal block_damaged
@onready var health_label: Label3D = $HealthLabel

@export var max_health = 200
@onready var health = max_health
func _ready() -> void:
health_label.text = str("Health: ", health)

func damage_func(amount:float) -> void:
block_damaged.emit()
health -= amount
health_label.text = str("Health: ", health)
if health <= 0:
death()

func death():
block_dead.emit()
queue_free()
56 changes: 56 additions & 0 deletions Scenes/Levels/first_level.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
extends Node3D

@onready var control_point: Marker3D = $Objects/control_point
@onready var block_41: CyclopsBlock = $CyclopsBlocks_upgraded/Block_41
@onready var block_holder: CharacterBody3D = $CyclopsBlocks_upgraded/Block_41/BlockHolder


func _on_abyss_body_entered(body: Node3D) -> void:
body.position = control_point.position


func _on_throw_combatants_building_complete() -> void:
$AnimationPlayer.play("BuildBridge")


func _on_throw_combatants_2_building_complete() -> void:
$AnimationPlayer.play("BuildCylinder")


func _on_block_holder_block_damaged() -> void:
var tween = get_tree().create_tween()
tween.tween_property(block_41, "position", Vector3(-17, 12, 49 - 5 * ((block_holder.max_health - block_holder.health) / block_holder.max_health)), 0.5)


func _on_block_holder_block_dead() -> void:
$AnimationPlayer.play("block_fall")


func _on_button_body_entered(body: Node3D) -> void:
$CyclopsBlocks_upgraded/Platforms/MovingSticks/AnimationPlayer.play("open_close")


func _on_floor_button_body_entered(body: Node3D) -> void:
var tween = get_tree().create_tween()
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/FloorButton/Yellow, "position", Vector3(-0.15, 0,0), 0.5)
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/Movable, "position", Vector3(-76, 14, 61), 2)

func _on_floor_button_body_exited(body: Node3D) -> void:
var tween = get_tree().create_tween()
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/FloorButton/Yellow, "position", Vector3(0.2, 0,0), 0.5)
if $CyclopsBlocks_upgraded/Door/FloorButton2.get_overlapping_bodies() == [] and $CyclopsBlocks_upgraded/Door/FloorButton.get_overlapping_bodies() == []:
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/Movable, "position", Vector3(-76, 9, 61), 2)


func _on_floor_button_2_body_entered(body: Node3D) -> void:
var tween = get_tree().create_tween()
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/FloorButton2/Yellow, "position", Vector3(-0.15, 0,0), 0.5)
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/Movable, "position", Vector3(-76, 14, 61), 2)


func _on_floor_button_2_body_exited(body: Node3D) -> void:
if $CyclopsBlocks_upgraded/Door/FloorButton2.get_overlapping_bodies() == []:
var tween = get_tree().create_tween()
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/FloorButton2/Yellow, "position", Vector3(0.2, 0,0), 0.5)
if $CyclopsBlocks_upgraded/Door/FloorButton.get_overlapping_bodies() == []:
tween.parallel().tween_property($CyclopsBlocks_upgraded/Door/Movable, "position", Vector3(-76, 9, 61), 2)
Loading