more improvements
This commit is contained in:
		| @ -36,8 +36,10 @@ func new_game(level): | |||||||
| 	if held_piece: | 	if held_piece: | ||||||
| 		remove_child(held_piece) | 		remove_child(held_piece) | ||||||
| 		held_piece = null | 		held_piece = null | ||||||
| 	autoshift_action = "" | 	if next_piece: | ||||||
|  | 		remove_child(next_piece) | ||||||
| 	next_piece = random_piece() | 	next_piece = random_piece() | ||||||
|  | 	autoshift_action = "" | ||||||
| 	$MidiPlayer.position = 0 | 	$MidiPlayer.position = 0 | ||||||
| 	$Stats.new_game(level) | 	$Stats.new_game(level) | ||||||
| 	new_piece() | 	new_piece() | ||||||
| @ -133,11 +135,9 @@ func hard_drop(): | |||||||
| 	lock() | 	lock() | ||||||
|  |  | ||||||
| func _on_DropTimer_timeout(): | func _on_DropTimer_timeout(): | ||||||
| 	current_piece.move(movements["soft_drop"]) |  | ||||||
|  |  | ||||||
| func _on_LockDelay_timeout(): |  | ||||||
| 	if not current_piece.move(movements["soft_drop"]): | 	if not current_piece.move(movements["soft_drop"]): | ||||||
| 		lock() | 		if $LockDelay.is_stopped(): | ||||||
|  | 			lock() | ||||||
| 		 | 		 | ||||||
| func lock(): | func lock(): | ||||||
| 	if $Matrix/GridMap.lock(current_piece): | 	if $Matrix/GridMap.lock(current_piece): | ||||||
|  | |||||||
| @ -426,7 +426,7 @@ autostart = false | |||||||
| [node name="AutoShiftTimer" type="Timer" parent="." index="9"] | [node name="AutoShiftTimer" type="Timer" parent="." index="9"] | ||||||
|  |  | ||||||
| process_mode = 1 | process_mode = 1 | ||||||
| wait_time = 0.03 | wait_time = 0.02 | ||||||
| one_shot = false | one_shot = false | ||||||
| autostart = false | autostart = false | ||||||
|  |  | ||||||
| @ -550,8 +550,6 @@ _sections_unfolded = [ "Margin", "custom_colors", "custom_fonts" ] | |||||||
|  |  | ||||||
| [connection signal="timeout" from="DropTimer" to="." method="_on_DropTimer_timeout"] | [connection signal="timeout" from="DropTimer" to="." method="_on_DropTimer_timeout"] | ||||||
|  |  | ||||||
| [connection signal="timeout" from="LockDelay" to="." method="_on_LockDelay_timeout"] |  | ||||||
|  |  | ||||||
| [connection signal="timeout" from="AutoShiftDelay" to="." method="_on_AutoShiftDelay_timeout"] | [connection signal="timeout" from="AutoShiftDelay" to="." method="_on_AutoShiftDelay_timeout"] | ||||||
|  |  | ||||||
| [connection signal="timeout" from="AutoShiftTimer" to="." method="_on_AutoShiftTimer_timeout"] | [connection signal="timeout" from="AutoShiftTimer" to="." method="_on_AutoShiftTimer_timeout"] | ||||||
|  | |||||||
| @ -77,7 +77,7 @@ func piece_locked(lines, t_spin): | |||||||
| 		ds = SCORES[lines][t_spin] | 		ds = SCORES[lines][t_spin] | ||||||
| 		goal -= ds | 		goal -= ds | ||||||
| 		$VBC/Goal.text = str(goal) | 		$VBC/Goal.text = str(goal) | ||||||
| 		ds *= 100 | 		ds *= 100 * level | ||||||
| 		emit_signal("flash_text", str(ds)) | 		emit_signal("flash_text", str(ds)) | ||||||
| 		score += ds | 		score += ds | ||||||
| 		$VBC/Score.text = str(score) | 		$VBC/Score.text = str(score) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user