Skip to content

Commit

Permalink
Merge pull request #12 from rafaelcastrocouto/main
Browse files Browse the repository at this point in the history
0.0.1 cadidate
  • Loading branch information
rafaelcastrocouto authored Mar 4, 2022
2 parents 531b1b8 + 777d247 commit db38130
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
Binary file modified Prototype/Assets/Level/Ground/water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Prototype/Assets/Res/Level_Tileset.tres
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
12/region = Rect2( 0, 0, 88, 40 )
12/tile_mode = 1
12/autotile/bitmask_mode = 1
12/autotile/bitmask_flags = [ Vector2( 0, 0 ), 432, Vector2( 0, 1 ), 438, Vector2( 0, 2 ), 54, Vector2( 0, 3 ), 48, Vector2( 1, 0 ), 504, Vector2( 1, 1 ), 511, Vector2( 1, 2 ), 63, Vector2( 1, 3 ), 56, Vector2( 2, 0 ), 216, Vector2( 2, 1 ), 219, Vector2( 2, 2 ), 27, Vector2( 2, 3 ), 24, Vector2( 3, 0 ), 144, Vector2( 3, 1 ), 146, Vector2( 3, 2 ), 18, Vector2( 3, 3 ), 16, Vector2( 4, 0 ), 176, Vector2( 4, 1 ), 182, Vector2( 4, 2 ), 434, Vector2( 4, 3 ), 50, Vector2( 4, 4 ), 178, Vector2( 5, 0 ), 248, Vector2( 5, 1 ), 255, Vector2( 5, 2 ), 507, Vector2( 5, 3 ), 59, Vector2( 5, 4 ), 251, Vector2( 6, 0 ), 440, Vector2( 6, 1 ), 447, Vector2( 6, 2 ), 510, Vector2( 6, 3 ), 62, Vector2( 6, 4 ), 446, Vector2( 7, 0 ), 152, Vector2( 7, 1 ), 155, Vector2( 7, 2 ), 218, Vector2( 7, 3 ), 26, Vector2( 7, 4 ), 154, Vector2( 8, 0 ), 184, Vector2( 8, 1 ), 191, Vector2( 8, 2 ), 506, Vector2( 8, 3 ), 58, Vector2( 8, 4 ), 186, Vector2( 9, 0 ), 443, Vector2( 9, 1 ), 254, Vector2( 9, 2 ), 442, Vector2( 9, 3 ), 190, Vector2( 10, 2 ), 250, Vector2( 10, 3 ), 187 ]
12/autotile/icon_coordinate = Vector2( 1, 1 )
12/autotile/bitmask_flags = [ Vector2( 0, 0 ), 432, Vector2( 0, 1 ), 438, Vector2( 0, 2 ), 54, Vector2( 0, 3 ), 48, Vector2( 0, 4 ), 511, Vector2( 1, 0 ), 504, Vector2( 1, 1 ), 511, Vector2( 1, 2 ), 63, Vector2( 1, 3 ), 56, Vector2( 1, 4 ), 511, Vector2( 2, 0 ), 216, Vector2( 2, 1 ), 219, Vector2( 2, 2 ), 27, Vector2( 2, 3 ), 24, Vector2( 2, 4 ), 511, Vector2( 3, 0 ), 144, Vector2( 3, 1 ), 146, Vector2( 3, 2 ), 18, Vector2( 3, 3 ), 16, Vector2( 3, 4 ), 511, Vector2( 4, 0 ), 176, Vector2( 4, 1 ), 182, Vector2( 4, 2 ), 434, Vector2( 4, 3 ), 50, Vector2( 4, 4 ), 178, Vector2( 5, 0 ), 248, Vector2( 5, 1 ), 255, Vector2( 5, 2 ), 507, Vector2( 5, 3 ), 59, Vector2( 5, 4 ), 251, Vector2( 6, 0 ), 440, Vector2( 6, 1 ), 447, Vector2( 6, 2 ), 510, Vector2( 6, 3 ), 62, Vector2( 6, 4 ), 446, Vector2( 7, 0 ), 152, Vector2( 7, 1 ), 155, Vector2( 7, 2 ), 218, Vector2( 7, 3 ), 26, Vector2( 7, 4 ), 154, Vector2( 8, 0 ), 184, Vector2( 8, 1 ), 191, Vector2( 8, 2 ), 506, Vector2( 8, 3 ), 58, Vector2( 8, 4 ), 186, Vector2( 9, 0 ), 443, Vector2( 9, 1 ), 254, Vector2( 9, 2 ), 442, Vector2( 9, 3 ), 190, Vector2( 10, 2 ), 250, Vector2( 10, 3 ), 187 ]
12/autotile/icon_coordinate = Vector2( 3, 3 )
12/autotile/tile_size = Vector2( 8, 8 )
12/autotile/spacing = 0
12/autotile/occluder_map = [ ]
Expand Down
10 changes: 6 additions & 4 deletions Prototype/Autoloads/Units.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ var navmap: Navigation2D = null

var arena_teams = {TeamID.Blue: null, TeamID.Red: null}

var creep_group_max_pool_count: int = 2
var creep_group_pool_count: int = 0
var creep_group_max_pool_count: Array = [2,2,2,2]
var creep_group_pool_count: Array = [0,0,0,0]

var available_creep_groups_pools: Array = []

onready var CreepGroupClass = load("res://Character/Child/Creep/CreepGroup.tscn")
Expand All @@ -35,11 +36,12 @@ func spawn_one(team: int, packed_scene: PackedScene, parent_node: Node2D, spawn_


func try_spawn_creep_wave(parent_node: Node2D) -> void:
print(arena_teams.keys())
for t in arena_teams.keys():
var new_creep_group: YSort = null
if creep_group_pool_count < creep_group_max_pool_count:
if creep_group_pool_count[t] < creep_group_max_pool_count[t]:
new_creep_group = spawn_one(t, CreepGroupClass, parent_node, arena_teams[t].mid_creep_spawner_position)
creep_group_pool_count += 2
creep_group_pool_count[t] += 2
else:
new_creep_group = available_creep_groups_pools.pop_front()

Expand Down
2 changes: 1 addition & 1 deletion Prototype/Battlefield/BattleField.tscn

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Prototype/Battlefield/TeamArea.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func _ready() -> void:

Game.connect("playing", self, "_on_Game_playing")
connect("spawn_creep", self, "_on_TeamArea_spawn_creep")

set_team(team)


Expand Down
2 changes: 0 additions & 2 deletions Prototype/GUI/Play.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
extends Button



func _on_Play_pressed() -> void:
if not Game.is_playing:
Game.emit_signal("playing")
Expand Down
3 changes: 2 additions & 1 deletion Prototype/GUI/SelectTeamButton/SelectTeamButton.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export(Units.TeamID) var team = Units.TeamID.Blue


func _on_Button_pressed() -> void:
Player.selected_team = team

Player.selected_team = self.team
1 change: 0 additions & 1 deletion Prototype/TestScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func _on_Game_playing() -> void:
Units.arena_teams[team].mid_creep_spawner_position + Vector2(rand_range(-100.0, 100.0), rand_range(-100.0, 100.0)))
$CreepRespawnTimer.start(Game.creep_respawn_time)
Game.is_playing = true
#print("First Spawn Creep")


func _on_CreepRespawnTimer_timeout() -> void:
Expand Down
9 changes: 5 additions & 4 deletions Prototype/TestScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[sub_resource type="ButtonGroup" id=3]

[node name="TestScene" type="Node2D"]
position = Vector2( 0, -1 )
script = ExtResource( 4 )

[node name="Menu" type="CanvasLayer" parent="."]
Expand Down Expand Up @@ -40,7 +41,8 @@ __meta__ = {
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -20.0
margin_top = -29.0
margin_bottom = -9.0
mouse_filter = 2
alignment = 1
__meta__ = {
Expand Down Expand Up @@ -72,15 +74,14 @@ margin_right = 410.0
margin_bottom = 20.0
toggle_mode = true
group = SubResource( 2 )
team = 1
team = 3

[node name="CreepRespawnTimer" type="Timer" parent="."]

[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2( 257, 152 )
current = true
limit_left = 0
limit_top = 0
smoothing_speed = 2.0
script = ExtResource( 1 )

[node name="UnitController" parent="." instance=ExtResource( 2 )]
Expand Down

0 comments on commit db38130

Please sign in to comment.