mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Fixed another space in a filename
This commit is contained in:
Phase2/Godot_GameCode/ResolvingTies
.import
.gdignoreicon.png-487276ed1e3a0c39cad0279d744ee560.md5icon.png-487276ed1e3a0c39cad0279d744ee560.stexicons8-reset-50.png-71e4ab05e2ac56cb1c906522bba8befc.md5icons8-reset-50.png-71e4ab05e2ac56cb1c906522bba8befc.stexok-button.png-99534f8614d55282ebd043cd5e696357.md5ok-button.png-99534f8614d55282ebd043cd5e696357.stex
Assets
Scene
Script
default_env.tresicon.pngicon.png.importproject.godot
40
Phase2/Godot_GameCode/ResolvingTies/Script/Resolve.gd
Normal file
40
Phase2/Godot_GameCode/ResolvingTies/Script/Resolve.gd
Normal file
@ -0,0 +1,40 @@
|
||||
extends Control
|
||||
|
||||
onready var player_1_stats = 0
|
||||
onready var player_2_stats = 0
|
||||
onready var line_edit_1 = $Player1/LineEdit
|
||||
onready var line_edit_2 = $Player2/LineEdit
|
||||
onready var result = $Result
|
||||
|
||||
func _ready():
|
||||
line_edit_1.grab_focus()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if player_1_stats != 0 and player_2_stats != 0 and !result.is_visible_in_tree():
|
||||
if player_1_stats > player_2_stats:
|
||||
$Result/RichTextLabel.add_text("Player 1 wins!")
|
||||
$Result.visible = true
|
||||
|
||||
elif player_2_stats > player_1_stats:
|
||||
$Result/RichTextLabel.add_text("Player 2 wins!")
|
||||
$Result.visible = true
|
||||
else:
|
||||
$Result/RichTextLabel.add_text("Re-roll!")
|
||||
$Result.visible = true
|
||||
|
||||
func _on_TextureButton1_pressed():
|
||||
player_1_stats = int(line_edit_1.text)
|
||||
|
||||
|
||||
func _on_TextureButton2_pressed():
|
||||
player_2_stats = int(line_edit_2.text)
|
||||
|
||||
|
||||
func _on_ResetButton_pressed():
|
||||
player_1_stats = 0
|
||||
player_2_stats = 0
|
||||
line_edit_1.clear()
|
||||
line_edit_2.clear()
|
||||
$Result/RichTextLabel.clear()
|
||||
result.visible = false
|
Reference in New Issue
Block a user