Compare commits
	
		
			2 Commits
		
	
	
		
			399ab622a2
			...
			5ccbc5ca9e
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 5ccbc5ca9e | |
|  | 23f8070ac1 | 
							
								
								
									
										10
									
								
								TODO.md
								
								
								
								
							
							
						
						|  | @ -3,17 +3,15 @@ | ||||||
|     * +health, +attack, +speed, +jump, (pawn only) remove "attack_only", spawn a new (random?) piece, change movement type |     * +health, +attack, +speed, +jump, (pawn only) remove "attack_only", spawn a new (random?) piece, change movement type | ||||||
|   * then the enemy respawns units, their new units are stronger |   * then the enemy respawns units, their new units are stronger | ||||||
|   * support for pieces with multiple hit points |   * support for pieces with multiple hit points | ||||||
|   * unit info panel |  | ||||||
| 2. Visual polish | 2. Visual polish | ||||||
|   * clean up tile borders |  | ||||||
|   * multiple square tiles to add variation |   * multiple square tiles to add variation | ||||||
|   * make the help text indicate (flash, etc.) |   * make the help text indicate (flash, etc.) | ||||||
| 3. Sound effects | 3. Sound effects | ||||||
|   * on hit |   * on hit | ||||||
|   * if possible, a small bit of background music |   * if possible, a small bit of background music | ||||||
| 4. Further visual polish | 4. New units | ||||||
| 5. New units | 5. Further visual polish | ||||||
| 
 | 
 | ||||||
| Bugs | Bugs of note: | ||||||
| 
 | 
 | ||||||
|  * if the player has no possible moves, there is no way to continue: add a skip turn button |  * n/a | ||||||
|  |  | ||||||
| After Width: | Height: | Size: 7.2 KiB | 
| Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 857 B | 
| After Width: | Height: | Size: 9.5 KiB | 
| After Width: | Height: | Size: 7.0 KiB | 
| After Width: | Height: | Size: 7.0 KiB | 
| After Width: | Height: | Size: 7.8 KiB | 
| After Width: | Height: | Size: 8.3 KiB | 
| After Width: | Height: | Size: 11 KiB | 
| After Width: | Height: | Size: 10 KiB | 
|  | @ -51,3 +51,13 @@ margin_right = 688.0 | ||||||
| margin_bottom = 116.0 | margin_bottom = 116.0 | ||||||
| custom_fonts/font = SubResource( 2 ) | custom_fonts/font = SubResource( 2 ) | ||||||
| text = "Quit" | text = "Quit" | ||||||
|  | 
 | ||||||
|  | [node name="Fail Game" type="Button" parent="VBoxContainer"] | ||||||
|  | margin_right = 12.0 | ||||||
|  | margin_bottom = 20.0 | ||||||
|  | text = "Fail Game" | ||||||
|  | 
 | ||||||
|  | [node name="Win Game" type="Button" parent="VBoxContainer"] | ||||||
|  | margin_right = 12.0 | ||||||
|  | margin_bottom = 20.0 | ||||||
|  | text = "Win Game" | ||||||
|  |  | ||||||
							
								
								
									
										68
									
								
								src/Game.gd
								
								
								
								
							
							
						
						|  | @ -99,6 +99,7 @@ func _on_hold_start(piece, event): | ||||||
| func _on_hold_stop(piece, event): | func _on_hold_stop(piece, event): | ||||||
| 	if self.selected_piece != null: | 	if self.selected_piece != null: | ||||||
| 		# deselect | 		# deselect | ||||||
|  | 		get_node("/root/Game/PanelRight/VBox/PieceInfo").set_visible(false) | ||||||
| 		var p = self.selected_piece | 		var p = self.selected_piece | ||||||
| 		if p.is_in_group("player"): | 		if p.is_in_group("player"): | ||||||
| 			p.get_node("Body").set_modulate(Color(1, 1, 1, 1)) | 			p.get_node("Body").set_modulate(Color(1, 1, 1, 1)) | ||||||
|  | @ -164,6 +165,7 @@ func pieces_hostile(p1, p2): | ||||||
| func _on_piece_click(piece, event): | func _on_piece_click(piece, event): | ||||||
| 	if self.selected_piece != null: | 	if self.selected_piece != null: | ||||||
| 		# deselect | 		# deselect | ||||||
|  | 		get_node("/root/Game/PanelRight/VBox/PieceInfo").set_visible(false) | ||||||
| 		var p = self.selected_piece | 		var p = self.selected_piece | ||||||
| 		if p.is_in_group("player"): | 		if p.is_in_group("player"): | ||||||
| 			p.get_node("Body").set_modulate(Color(1, 1, 1, 1)) | 			p.get_node("Body").set_modulate(Color(1, 1, 1, 1)) | ||||||
|  | @ -186,6 +188,8 @@ func _on_piece_click(piece, event): | ||||||
| 	var square = square_of_piece(piece) | 	var square = square_of_piece(piece) | ||||||
| 	var moves = get_valid_piece_moves(piece) | 	var moves = get_valid_piece_moves(piece) | ||||||
| 	set_square_hilights_for_moves(moves) | 	set_square_hilights_for_moves(moves) | ||||||
|  | 	get_node("/root/Game/PanelRight/VBox/PieceInfo").set_piece_info(piece) | ||||||
|  | 	get_node("/root/Game/PanelRight/VBox/PieceInfo").set_visible(true) | ||||||
| 
 | 
 | ||||||
| func clear_square_hilights_for_moves(moves): | func clear_square_hilights_for_moves(moves): | ||||||
| 	var pf = get_node("/root/Game/MarginContainer/Playfield") | 	var pf = get_node("/root/Game/MarginContainer/Playfield") | ||||||
|  | @ -253,15 +257,19 @@ func _ready(): | ||||||
| 	 | 	 | ||||||
| 	get_node("/root/Game/EndMenu/VBoxContainer/New").connect("pressed", self, "_on_new_game_pressed") | 	get_node("/root/Game/EndMenu/VBoxContainer/New").connect("pressed", self, "_on_new_game_pressed") | ||||||
| 	get_node("/root/Game/EndMenu/VBoxContainer/Quit").connect("pressed", self, "_on_quit_game_pressed") | 	get_node("/root/Game/EndMenu/VBoxContainer/Quit").connect("pressed", self, "_on_quit_game_pressed") | ||||||
|  | 	get_node("/root/Game/EndMenu/VBoxContainer/Fail Game").connect("pressed", self, "_on_fail_game") | ||||||
|  | 	get_node("/root/Game/EndMenu/VBoxContainer/Win Game").connect("pressed", self, "_on_win_game") | ||||||
| 	reset_game_state() | 	reset_game_state() | ||||||
| 
 | 
 | ||||||
| func _input(ev): | func _input(ev): | ||||||
| 	if Input.is_action_just_pressed("ui_cancel"): | 	if Input.is_action_just_pressed("ui_cancel"): | ||||||
| 		print(ev) | 		print(ev) | ||||||
| 		self._on_escape() | 		self._on_escape(false, "Paused") | ||||||
| 
 | 
 | ||||||
| func _on_escape(force_visible = false): | func _on_escape(force_visible = false, message = null): | ||||||
| 	var n = get_node("/root/Game/EndMenu") | 	var n = get_node("/root/Game/EndMenu") | ||||||
|  | 	if message != null: | ||||||
|  | 		n.get_node("VBoxContainer/Label").set_text(message) | ||||||
| 	if n.is_visible() and not force_visible: | 	if n.is_visible() and not force_visible: | ||||||
| 		n.set_visible(false) | 		n.set_visible(false) | ||||||
| 	else: | 	else: | ||||||
|  | @ -336,6 +344,10 @@ func _on_phase_end(): | ||||||
| 	if not self.current_state in self.states.keys(): | 	if not self.current_state in self.states.keys(): | ||||||
| 		self.current_state = 0 | 		self.current_state = 0 | ||||||
| 		self._on_new_turn() | 		self._on_new_turn() | ||||||
|  | 	if self.current_state == 0: | ||||||
|  | 		get_node("PanelRight/VBox/HBox/VBox/HBox/SkipTurnButton").set_disabled(false) | ||||||
|  | 	else: | ||||||
|  | 		get_node("PanelRight/VBox/HBox/VBox/HBox/SkipTurnButton").set_disabled(true) | ||||||
| 	get_node("TopBar/Bottom/Instruction").set_text( | 	get_node("TopBar/Bottom/Instruction").set_text( | ||||||
| 		self.states[self.current_state]["description"] + " - " + self.states[self.current_state]["directive"] | 		self.states[self.current_state]["description"] + " - " + self.states[self.current_state]["directive"] | ||||||
| 		) | 		) | ||||||
|  | @ -430,8 +442,32 @@ func _on_new_turn(): | ||||||
| 	get_node("TopBar/Top/HBoxContainer/Turn").set_text(str(self.turn)) | 	get_node("TopBar/Top/HBoxContainer/Turn").set_text(str(self.turn)) | ||||||
| 
 | 
 | ||||||
| func _reset_help(): | func _reset_help(): | ||||||
| 	get_node("BottomBar/Help").set_text("Delay losing as long as possible. Your loss is inevitable.\nClick on piece to see it's possible moves and stats.\nDrag and drop a piece to make a move.") | 	get_node("BottomBar/Help").set_text("Delay losing as long as possible. Your will lose.\nClick on piece to see it's possible moves and stats.\nDrag and drop a piece to make a move.") | ||||||
| 
 | 
 | ||||||
|  | func _on_game_end(force_condition = null): | ||||||
|  | 	get_node("/root/Game/TopBar/Bottom/Instruction").set_text("Game over") | ||||||
|  | 	self.current_state = 99 | ||||||
|  | 	var player_victory = false | ||||||
|  | 	if force_condition == null: | ||||||
|  | 		if get_tree().get_nodes_in_group("opponent").empty(): | ||||||
|  | 			player_victory = true | ||||||
|  | 	else: | ||||||
|  | 		player_victory = force_condition | ||||||
|  | 	if not player_victory: | ||||||
|  | 		get_node("/root/Game/EndSong").play() | ||||||
|  | 		get_node("/root/Game/BottomBar/Help").set_text("Unsurprisingly, the result was known before-hand.") | ||||||
|  | 	else: | ||||||
|  | 		get_node("/root/Game/BottomBar/Help").set_text("Well, I'll be damned. I didn't think this would happen!") | ||||||
|  | 		get_node("/root/Game/Impossible").play() | ||||||
|  | 	# Show a popup for new one, or quit | ||||||
|  | 	self._on_escape(true, "Game over!") | ||||||
|  | 		 | ||||||
|  | func _on_fail_game(): | ||||||
|  | 	_on_game_end(false) | ||||||
|  | 	 | ||||||
|  | func _on_win_game(): | ||||||
|  | 	_on_game_end(true) | ||||||
|  | 	 | ||||||
| # Called every frame. 'delta' is the elapsed time since the previous frame. | # Called every frame. 'delta' is the elapsed time since the previous frame. | ||||||
| func _process(delta): | func _process(delta): | ||||||
| 	if self.flash_help != null: | 	if self.flash_help != null: | ||||||
|  | @ -441,21 +477,9 @@ func _process(delta): | ||||||
| 			self._reset_help() | 			self._reset_help() | ||||||
| 			self.flash_help = null | 			self.flash_help = null | ||||||
| 	var opponent_pieces = get_tree().get_nodes_in_group("opponent") | 	var opponent_pieces = get_tree().get_nodes_in_group("opponent") | ||||||
| 	if opponent_pieces.empty() or get_tree().get_nodes_in_group("player").empty(): | 	if opponent_pieces.empty() or get_tree().get_nodes_in_group("player").empty() and self.current_state != 99: | ||||||
| 		# The game is over | 		# The game is over | ||||||
| 		self.current_state = 99 | 		self._on_game_end() | ||||||
| 		var player_victory = false |  | ||||||
| 		if get_tree().get_nodes_in_group("opponent").empty(): |  | ||||||
| 			player_victory = true |  | ||||||
| 		get_node("/root/Game/TopBar/Bottom/Instruction").set_text("Game over") |  | ||||||
| 		if not player_victory: |  | ||||||
| 			get_node("/root/Game/EndSong").play() |  | ||||||
| 			get_node("/root/Game/BottomBar/Help").set_text("Unsurprisingly, the result was known before-hand.") |  | ||||||
| 		else: |  | ||||||
| 			get_node("/root/Game/BottomBar/Help").set_text("Well, I'll be damned. I didn't think this would happen!") |  | ||||||
| 			get_node("/root/Game/Impossible").play() |  | ||||||
| 		# Show a popup for new one, or quit |  | ||||||
| 		self._on_escape(true) |  | ||||||
| 	if self.current_state == 1: | 	if self.current_state == 1: | ||||||
| 		if self.ai_target != null: | 		if self.ai_target != null: | ||||||
| 			var target_square = self.board_squares[self.ai_target] | 			var target_square = self.board_squares[self.ai_target] | ||||||
|  | @ -469,9 +493,12 @@ func _process(delta): | ||||||
| 				) | 				) | ||||||
| 			else: | 			else: | ||||||
| 				# End movement | 				# End movement | ||||||
|  | 				var square = square_of_piece(self.ai_piece) | ||||||
| 				if target_square['piece'] != null: | 				if target_square['piece'] != null: | ||||||
| 					# @TODO If the target doesn't die, we need to bounce back | 					# @TODO If the target doesn't die, we need to bounce back | ||||||
| 					target_square['piece'].queue_free() | 					target_square['piece'].queue_free() | ||||||
|  | 					square['piece'].kills += 1 | ||||||
|  | 					get_node("PanelRight/VBox/PieceInfo").set_piece_info(square['piece']) | ||||||
| 					var c = self.rng.randi() % 100 | 					var c = self.rng.randi() % 100 | ||||||
| 					var index_to_play = null | 					var index_to_play = null | ||||||
| 					for idx in self.on_player_lose_piece.keys(): | 					for idx in self.on_player_lose_piece.keys(): | ||||||
|  | @ -481,7 +508,6 @@ func _process(delta): | ||||||
| 					if index_to_play != null: | 					if index_to_play != null: | ||||||
| 						print("ai loss Chance to play: ", c, " got index ", index_to_play) | 						print("ai loss Chance to play: ", c, " got index ", index_to_play) | ||||||
| 						get_node(self.on_player_lose_piece[index_to_play]).play() | 						get_node(self.on_player_lose_piece[index_to_play]).play() | ||||||
| 				var square = square_of_piece(self.ai_piece) |  | ||||||
| 				square['piece'] = null | 				square['piece'] = null | ||||||
| 				target_square['piece'] = self.ai_piece | 				target_square['piece'] = self.ai_piece | ||||||
| 				self.ai_piece.set_position(Vector2(target_square['x']*128, target_square['y']*128)) | 				self.ai_piece.set_position(Vector2(target_square['x']*128, target_square['y']*128)) | ||||||
|  | @ -554,6 +580,8 @@ func _physics_process(delta): | ||||||
| 					if dest_square['piece'] != null: | 					if dest_square['piece'] != null: | ||||||
| 						# @TODO If the target doesn't die, we need to bounce back | 						# @TODO If the target doesn't die, we need to bounce back | ||||||
| 						dest_square['piece'].queue_free() | 						dest_square['piece'].queue_free() | ||||||
|  | 						square['piece'].kills += 1 | ||||||
|  | 						get_node("PanelRight/VBox/PieceInfo").set_piece_info(square['piece']) | ||||||
| 						var c = self.rng.randi() % 100 | 						var c = self.rng.randi() % 100 | ||||||
| 						var index_to_play = null | 						var index_to_play = null | ||||||
| 						for idx in self.on_ai_lose_piece.keys(): | 						for idx in self.on_ai_lose_piece.keys(): | ||||||
|  | @ -608,3 +636,7 @@ func _on_Huh_finished(): | ||||||
| 
 | 
 | ||||||
| func _on_StopThat_finished(): | func _on_StopThat_finished(): | ||||||
| 	get_node("/root/Game/StopThat").stop() | 	get_node("/root/Game/StopThat").stop() | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | func _on_SkipTurnButton_pressed(): | ||||||
|  | 	self._on_phase_end() | ||||||
|  |  | ||||||
|  | @ -1,11 +1,11 @@ | ||||||
| [gd_scene load_steps=15 format=2] | [gd_scene load_steps=21 format=2] | ||||||
| 
 | 
 | ||||||
| [ext_resource path="res://src/Game.gd" type="Script" id=1] | [ext_resource path="res://src/Game.gd" type="Script" id=1] | ||||||
| [ext_resource path="res://src/Playfield.tscn" type="PackedScene" id=2] | [ext_resource path="res://src/Playfield.tscn" type="PackedScene" id=2] | ||||||
| [ext_resource path="res://src/large font.tres" type="DynamicFont" id=3] | [ext_resource path="res://src/large font.tres" type="DynamicFont" id=3] | ||||||
| [ext_resource path="res://assets/source/Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf" type="DynamicFontData" id=4] | [ext_resource path="res://assets/source/Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf" type="DynamicFontData" id=4] | ||||||
| [ext_resource path="res://src/EndMenu.tscn" type="PackedScene" id=5] | [ext_resource path="res://src/EndMenu.tscn" type="PackedScene" id=5] | ||||||
| [ext_resource path="res://assets/export/end_song.ogg" type="AudioStream" id=6] | [ext_resource path="res://assets/export/end_song.wav" type="AudioStream" id=6] | ||||||
| [ext_resource path="res://assets/export/impossible.wav" type="AudioStream" id=7] | [ext_resource path="res://assets/export/impossible.wav" type="AudioStream" id=7] | ||||||
| [ext_resource path="res://assets/export/thinkyoucan.wav" type="AudioStream" id=8] | [ext_resource path="res://assets/export/thinkyoucan.wav" type="AudioStream" id=8] | ||||||
| [ext_resource path="res://assets/export/yammering.wav" type="AudioStream" id=9] | [ext_resource path="res://assets/export/yammering.wav" type="AudioStream" id=9] | ||||||
|  | @ -13,11 +13,19 @@ | ||||||
| [ext_resource path="res://assets/export/huh.wav" type="AudioStream" id=11] | [ext_resource path="res://assets/export/huh.wav" type="AudioStream" id=11] | ||||||
| [ext_resource path="res://assets/export/dust.wav" type="AudioStream" id=12] | [ext_resource path="res://assets/export/dust.wav" type="AudioStream" id=12] | ||||||
| [ext_resource path="res://assets/export/hehe.wav" type="AudioStream" id=13] | [ext_resource path="res://assets/export/hehe.wav" type="AudioStream" id=13] | ||||||
|  | [ext_resource path="res://assets/export/skip.png" type="Texture" id=14] | ||||||
|  | [ext_resource path="res://assets/export/skip_pressed.png" type="Texture" id=15] | ||||||
|  | [ext_resource path="res://assets/export/skip_disabled.png" type="Texture" id=16] | ||||||
|  | [ext_resource path="res://assets/export/skip_hover.png" type="Texture" id=17] | ||||||
|  | [ext_resource path="res://src/PieceDetails.tscn" type="PackedScene" id=18] | ||||||
| 
 | 
 | ||||||
| [sub_resource type="DynamicFont" id=1] | [sub_resource type="DynamicFont" id=1] | ||||||
| size = 24 | size = 24 | ||||||
| font_data = ExtResource( 4 ) | font_data = ExtResource( 4 ) | ||||||
| 
 | 
 | ||||||
|  | [sub_resource type="DynamicFont" id=2] | ||||||
|  | font_data = ExtResource( 4 ) | ||||||
|  | 
 | ||||||
| [node name="Game" type="Container"] | [node name="Game" type="Container"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
|  | @ -105,11 +113,9 @@ text = "Do a thing" | ||||||
| valign = 1 | valign = 1 | ||||||
| 
 | 
 | ||||||
| [node name="EndMenu" parent="." instance=ExtResource( 5 )] | [node name="EndMenu" parent="." instance=ExtResource( 5 )] | ||||||
| visible = true |  | ||||||
| 
 | 
 | ||||||
| [node name="EndSong" type="AudioStreamPlayer" parent="."] | [node name="EndSong" type="AudioStreamPlayer" parent="."] | ||||||
| stream = ExtResource( 6 ) | stream = ExtResource( 6 ) | ||||||
| volume_db = 4.0 |  | ||||||
| autoplay = true | autoplay = true | ||||||
| 
 | 
 | ||||||
| [node name="Yammering" type="AudioStreamPlayer" parent="."] | [node name="Yammering" type="AudioStreamPlayer" parent="."] | ||||||
|  | @ -132,6 +138,70 @@ stream = ExtResource( 11 ) | ||||||
| 
 | 
 | ||||||
| [node name="StopThat" type="AudioStreamPlayer" parent="."] | [node name="StopThat" type="AudioStreamPlayer" parent="."] | ||||||
| stream = ExtResource( 10 ) | stream = ExtResource( 10 ) | ||||||
|  | 
 | ||||||
|  | [node name="PanelRight" type="Panel" parent="."] | ||||||
|  | anchor_right = 1.0 | ||||||
|  | anchor_bottom = 1.0 | ||||||
|  | margin_left = 1036.0 | ||||||
|  | 
 | ||||||
|  | [node name="VBox" type="VBoxContainer" parent="PanelRight"] | ||||||
|  | anchor_right = 1.0 | ||||||
|  | anchor_bottom = 1.0 | ||||||
|  | margin_left = 15.0 | ||||||
|  | margin_top = 15.0 | ||||||
|  | margin_right = -15.0 | ||||||
|  | margin_bottom = -15.0 | ||||||
|  | __meta__ = { | ||||||
|  | "_edit_use_anchors_": false | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | [node name="HBox" type="HBoxContainer" parent="PanelRight/VBox"] | ||||||
|  | margin_right = 214.0 | ||||||
|  | margin_bottom = 87.0 | ||||||
|  | alignment = 2 | ||||||
|  | 
 | ||||||
|  | [node name="VBox" type="VBoxContainer" parent="PanelRight/VBox/HBox"] | ||||||
|  | margin_left = 124.0 | ||||||
|  | margin_right = 214.0 | ||||||
|  | margin_bottom = 87.0 | ||||||
|  | alignment = 1 | ||||||
|  | 
 | ||||||
|  | [node name="HBox" type="HBoxContainer" parent="PanelRight/VBox/HBox/VBox"] | ||||||
|  | margin_right = 90.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | alignment = 1 | ||||||
|  | 
 | ||||||
|  | [node name="SkipTurnButton" type="TextureButton" parent="PanelRight/VBox/HBox/VBox/HBox"] | ||||||
|  | margin_left = 13.0 | ||||||
|  | margin_right = 77.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | hint_tooltip = "Skip Turn" | ||||||
|  | texture_normal = ExtResource( 14 ) | ||||||
|  | texture_pressed = ExtResource( 15 ) | ||||||
|  | texture_hover = ExtResource( 17 ) | ||||||
|  | texture_disabled = ExtResource( 16 ) | ||||||
|  | stretch_mode = 3 | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="PanelRight/VBox/HBox/VBox"] | ||||||
|  | margin_top = 68.0 | ||||||
|  | margin_right = 90.0 | ||||||
|  | margin_bottom = 87.0 | ||||||
|  | custom_fonts/font = SubResource( 2 ) | ||||||
|  | text = "Skip Turn" | ||||||
|  | align = 1 | ||||||
|  | valign = 1 | ||||||
|  | 
 | ||||||
|  | [node name="PieceInfo" parent="PanelRight/VBox" instance=ExtResource( 18 )] | ||||||
|  | visible = false | ||||||
|  | anchor_right = 0.0 | ||||||
|  | anchor_bottom = 0.0 | ||||||
|  | margin_top = 91.0 | ||||||
|  | margin_right = 214.0 | ||||||
|  | margin_bottom = 91.0 | ||||||
|  | 
 | ||||||
|  | [node name="PanelLeft" type="Panel" parent="."] | ||||||
|  | margin_right = 240.0 | ||||||
|  | margin_bottom = 1024.0 | ||||||
| [connection signal="finished" from="EndSong" to="." method="_on_EndSong_finished"] | [connection signal="finished" from="EndSong" to="." method="_on_EndSong_finished"] | ||||||
| [connection signal="finished" from="Yammering" to="." method="_on_Yammering_finished"] | [connection signal="finished" from="Yammering" to="." method="_on_Yammering_finished"] | ||||||
| [connection signal="finished" from="Dust" to="." method="_on_Dust_finished"] | [connection signal="finished" from="Dust" to="." method="_on_Dust_finished"] | ||||||
|  | @ -140,3 +210,4 @@ stream = ExtResource( 10 ) | ||||||
| [connection signal="finished" from="Hehe" to="." method="_on_Hehe_finished"] | [connection signal="finished" from="Hehe" to="." method="_on_Hehe_finished"] | ||||||
| [connection signal="finished" from="Huh" to="." method="_on_Huh_finished"] | [connection signal="finished" from="Huh" to="." method="_on_Huh_finished"] | ||||||
| [connection signal="finished" from="StopThat" to="." method="_on_StopThat_finished"] | [connection signal="finished" from="StopThat" to="." method="_on_StopThat_finished"] | ||||||
|  | [connection signal="pressed" from="PanelRight/VBox/HBox/VBox/HBox/SkipTurnButton" to="." method="_on_SkipTurnButton_pressed"] | ||||||
|  |  | ||||||
|  | @ -76,7 +76,7 @@ func init_move_dict(position): | ||||||
| 		"attack": true, | 		"attack": true, | ||||||
| 		"pos": position, | 		"pos": position, | ||||||
| 		"attack_only": false, | 		"attack_only": false, | ||||||
| 		"jump": false, | 		"jump": self.jump, | ||||||
| 		"source": self, | 		"source": self, | ||||||
| 	} | 	} | ||||||
| 	return x | 	return x | ||||||
|  |  | ||||||
|  | @ -0,0 +1,20 @@ | ||||||
|  | extends Control | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | # Declare member variables here. Examples: | ||||||
|  | # var a = 2 | ||||||
|  | # var b = "text" | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | # Called when the node enters the scene tree for the first time. | ||||||
|  | func _ready(): | ||||||
|  | 	pass # Replace with function body. | ||||||
|  | 
 | ||||||
|  | func set_piece_info(piece): | ||||||
|  | 	get_node("Vbox/Damage/Label").set_text(str(piece.damage)) | ||||||
|  | 	get_node("Vbox/Movement/Label").set_text(str(piece.speed)) | ||||||
|  | 	get_node("Vbox/Health/Label").set_text(str(piece.health)) | ||||||
|  | 	get_node("Vbox/Kills/Label").set_text(str(piece.kills)) | ||||||
|  | # Called every frame. 'delta' is the elapsed time since the previous frame. | ||||||
|  | #func _process(delta): | ||||||
|  | #	pass | ||||||
|  | @ -0,0 +1,108 @@ | ||||||
|  | [gd_scene load_steps=8 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://src/font_32.tres" type="DynamicFont" id=1] | ||||||
|  | [ext_resource path="res://assets/export/health.png" type="Texture" id=2] | ||||||
|  | [ext_resource path="res://src/black_hilight_2px.tres" type="Material" id=3] | ||||||
|  | [ext_resource path="res://assets/export/movement.png" type="Texture" id=4] | ||||||
|  | [ext_resource path="res://assets/export/attack.png" type="Texture" id=5] | ||||||
|  | [ext_resource path="res://assets/export/kills.png" type="Texture" id=6] | ||||||
|  | [ext_resource path="res://src/PieceDetails.gd" type="Script" id=7] | ||||||
|  | 
 | ||||||
|  | [node name="Control" type="Control"] | ||||||
|  | anchor_right = 1.0 | ||||||
|  | anchor_bottom = 1.0 | ||||||
|  | script = ExtResource( 7 ) | ||||||
|  | __meta__ = { | ||||||
|  | "_edit_use_anchors_": false | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | [node name="Vbox" type="VBoxContainer" parent="."] | ||||||
|  | margin_right = 40.0 | ||||||
|  | margin_bottom = 40.0 | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="Vbox"] | ||||||
|  | margin_right = 190.0 | ||||||
|  | margin_bottom = 79.0 | ||||||
|  | custom_fonts/font = ExtResource( 1 ) | ||||||
|  | text = "Piece info | ||||||
|  | " | ||||||
|  | 
 | ||||||
|  | [node name="Movement" type="HBoxContainer" parent="Vbox"] | ||||||
|  | margin_top = 83.0 | ||||||
|  | margin_right = 190.0 | ||||||
|  | margin_bottom = 147.0 | ||||||
|  | 
 | ||||||
|  | [node name="TextureRect" type="TextureRect" parent="Vbox/Movement"] | ||||||
|  | material = ExtResource( 3 ) | ||||||
|  | margin_right = 64.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | hint_tooltip = "Movement" | ||||||
|  | texture = ExtResource( 4 ) | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="Vbox/Movement"] | ||||||
|  | margin_left = 68.0 | ||||||
|  | margin_top = 13.0 | ||||||
|  | margin_right = 87.0 | ||||||
|  | margin_bottom = 51.0 | ||||||
|  | custom_fonts/font = ExtResource( 1 ) | ||||||
|  | text = "1	" | ||||||
|  | __meta__ = { | ||||||
|  | "_editor_description_": "" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | [node name="Health" type="HBoxContainer" parent="Vbox"] | ||||||
|  | margin_top = 151.0 | ||||||
|  | margin_right = 190.0 | ||||||
|  | margin_bottom = 215.0 | ||||||
|  | 
 | ||||||
|  | [node name="TextureRect" type="TextureRect" parent="Vbox/Health"] | ||||||
|  | material = ExtResource( 3 ) | ||||||
|  | margin_right = 64.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | texture = ExtResource( 2 ) | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="Vbox/Health"] | ||||||
|  | margin_left = 68.0 | ||||||
|  | margin_top = 13.0 | ||||||
|  | margin_right = 87.0 | ||||||
|  | margin_bottom = 51.0 | ||||||
|  | custom_fonts/font = ExtResource( 1 ) | ||||||
|  | text = "1	" | ||||||
|  | 
 | ||||||
|  | [node name="Damage" type="HBoxContainer" parent="Vbox"] | ||||||
|  | margin_top = 219.0 | ||||||
|  | margin_right = 190.0 | ||||||
|  | margin_bottom = 283.0 | ||||||
|  | 
 | ||||||
|  | [node name="TextureRect" type="TextureRect" parent="Vbox/Damage"] | ||||||
|  | material = ExtResource( 3 ) | ||||||
|  | margin_right = 64.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | texture = ExtResource( 5 ) | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="Vbox/Damage"] | ||||||
|  | margin_left = 68.0 | ||||||
|  | margin_top = 13.0 | ||||||
|  | margin_right = 87.0 | ||||||
|  | margin_bottom = 51.0 | ||||||
|  | custom_fonts/font = ExtResource( 1 ) | ||||||
|  | text = "1" | ||||||
|  | 
 | ||||||
|  | [node name="Kills" type="HBoxContainer" parent="Vbox"] | ||||||
|  | margin_top = 287.0 | ||||||
|  | margin_right = 190.0 | ||||||
|  | margin_bottom = 351.0 | ||||||
|  | 
 | ||||||
|  | [node name="TextureRect" type="TextureRect" parent="Vbox/Kills"] | ||||||
|  | material = ExtResource( 3 ) | ||||||
|  | margin_right = 64.0 | ||||||
|  | margin_bottom = 64.0 | ||||||
|  | texture = ExtResource( 6 ) | ||||||
|  | 
 | ||||||
|  | [node name="Label" type="Label" parent="Vbox/Kills"] | ||||||
|  | margin_left = 68.0 | ||||||
|  | margin_top = 13.0 | ||||||
|  | margin_right = 87.0 | ||||||
|  | margin_bottom = 51.0 | ||||||
|  | custom_fonts/font = ExtResource( 1 ) | ||||||
|  | text = "1" | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| [gd_scene load_steps=5 format=2] | [gd_scene load_steps=5 format=2] | ||||||
| 
 | 
 | ||||||
| [ext_resource path="res://assets/export/square_edge.png" type="Texture" id=1] | [ext_resource path="res://assets/export/edge.png" type="Texture" id=1] | ||||||
| [ext_resource path="res://assets/export/square_center_0.png" type="Texture" id=2] | [ext_resource path="res://assets/export/square_center_0.png" type="Texture" id=2] | ||||||
| [ext_resource path="res://src/Square.gd" type="Script" id=3] | [ext_resource path="res://src/Square.gd" type="Script" id=3] | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,8 @@ | ||||||
|  | [gd_resource type="ShaderMaterial" load_steps=2 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://src/hilight.shader" type="Shader" id=1] | ||||||
|  | 
 | ||||||
|  | [resource] | ||||||
|  | shader = ExtResource( 1 ) | ||||||
|  | shader_param/width = 2.0 | ||||||
|  | shader_param/color = null | ||||||
|  | @ -0,0 +1,7 @@ | ||||||
|  | [gd_resource type="DynamicFont" load_steps=2 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://assets/source/Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf" type="DynamicFontData" id=1] | ||||||
|  | 
 | ||||||
|  | [resource] | ||||||
|  | size = 32 | ||||||
|  | font_data = ExtResource( 1 ) | ||||||
|  | @ -9,6 +9,7 @@ extends Piece | ||||||
| # Called when the node enters the scene tree for the first time. | # Called when the node enters the scene tree for the first time. | ||||||
| func _ready(): | func _ready(): | ||||||
| 	self.speed = 1 | 	self.speed = 1 | ||||||
|  | 	self.jump = true | ||||||
| 
 | 
 | ||||||
| func get_possible_moves(position): | func get_possible_moves(position): | ||||||
| 	var directions = [ | 	var directions = [ | ||||||
|  | @ -29,7 +30,6 @@ func get_possible_moves(position): | ||||||
| 			var opt = self.init_move_dict( | 			var opt = self.init_move_dict( | ||||||
| 				Vector2(position.x+(d.x*i), position.y+(d.y)*i) | 				Vector2(position.x+(d.x*i), position.y+(d.y)*i) | ||||||
| 			) | 			) | ||||||
| 			opt.jump = true |  | ||||||
| 			d_opts.append(opt) | 			d_opts.append(opt) | ||||||
| 			i += 1 | 			i += 1 | ||||||
| 		options.append(d_opts) | 		options.append(d_opts) | ||||||
|  |  | ||||||