Pushed Changes

This commit is contained in:
Luke Gebbink 2022-01-16 13:00:25 -07:00
parent 84ff2a453f
commit be8d1addee
3 changed files with 54 additions and 25 deletions

View File

@ -1,9 +1,6 @@
extends Node
class_name Die
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
enum DieCategory{
D4 = 4,
@ -18,7 +15,6 @@ enum DieCategory{
var DieType = DieCategory
var NumberOfFaces = 0
func RollDie(InputDie):
#InputDie is supposed to be DieType for example.
var DieFaceResult = 0;
@ -45,15 +41,8 @@ func RollDie(InputDie):
print("Die Success Rate")
print(DieSuccessPercentage)
func SetNumberOfSides():
var DSides = DieType
# For 7 Die Set, testing purposes
########################################
# Need to Seed Random Number Generator #
########################################
match DSides:
4:
@ -72,16 +61,8 @@ func SetNumberOfSides():
NumberOfFaces = 20
print(NumberOfFaces)
# Called when the node enters the scene tree for the first time.
func _ready():
DieType = DieCategory.D00
SetNumberOfSides()
RollDie(NumberOfFaces)
# Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -1,5 +1,42 @@
extends MarginContainer
onready var selection_Start = $HBoxContainer/VBoxContainer/MenuOptions/StartGame
onready var selection_DieTest = $HBoxContainer/VBoxContainer/MenuOptions/DieTest
onready var selection_LoadGame = $HBoxContainer/CenterContainer/MenuOptions/LoadGame
onready var selection_HostAndJoinGame = $HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame
onready var selection_PlayerSettings =$HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings
var currentSelectionIndex = 0;
func _ready():
var TimeTest = OS.get_datetime()
print(TimeTest)
func _process(delta):
if Input.is_action_just_pressed("ui_down"):
currentSelectionIndex +=1;
if(currentSelectionIndex == 5):
currentSelectionIndex = 0
SetMenuSelections(currentSelectionIndex)
func SetMenuSelections(CurrentSelection):
selection_Start.set_uppercase(false)
selection_DieTest.set_uppercase(false)
selection_LoadGame.set_uppercase(false)
selection_HostAndJoinGame.set_uppercase(false)
selection_PlayerSettings.set_uppercase(false)
var index = CurrentSelection
match index:
0:
selection_Start.set_uppercase(true)
1:
selection_DieTest.set_uppercase(true)
2:
selection_LoadGame.set_uppercase(true)
3:
selection_HostAndJoinGame.set_uppercase(true)
4:
selection_PlayerSettings.set_uppercase(true)

View File

@ -20,6 +20,11 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ColorRect" type="ColorRect" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
color = Color( 0.858824, 0.333333, 0.129412, 1 )
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_left = 120.0
margin_top = 80.0
@ -41,6 +46,7 @@ alignment = 1
margin_top = 125.0
margin_right = 112.0
margin_bottom = 139.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1
text = "Start Game"
script = ExtResource( 3 )
@ -49,6 +55,7 @@ script = ExtResource( 3 )
margin_top = 169.0
margin_right = 112.0
margin_bottom = 183.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1
text = "Die Test"
script = ExtResource( 5 )
@ -57,6 +64,7 @@ script = ExtResource( 5 )
margin_top = 213.0
margin_right = 112.0
margin_bottom = 227.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1
text = "Load Game"
script = ExtResource( 3 )
@ -65,6 +73,7 @@ script = ExtResource( 3 )
margin_top = 257.0
margin_right = 112.0
margin_bottom = 271.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1
text = "Host / Join Game"
script = ExtResource( 2 )
@ -73,6 +82,7 @@ script = ExtResource( 2 )
margin_top = 301.0
margin_right = 112.0
margin_bottom = 315.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1
text = "Player Settings"
script = ExtResource( 1 )
@ -89,6 +99,7 @@ margin_left = 300.0
margin_top = 213.0
margin_right = 367.0
margin_bottom = 227.0
rect_scale = Vector2( 4, 4 )
text = "Test Menu"
[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/StartGame" to="HBoxContainer/VBoxContainer/MenuOptions/StartGame" method="_on_Start_Game_gui_input"]