bcirpggithubmirror/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918A/globalScripts/Die.gd
MacDugRPG b15d2976e8 Creates Merged Master
Creates the Merged Master game code as discussed in meeting for us all to branch and work off of.
2022-09-18 13:40:23 -04:00

25 lines
413 B
GDScript

#Die class
extends Node2D
class_name Die
#value of selected die type
var numFaces: int
#Class constructor
func _init(value):
numFaces = value
#returns an integer value of the rolled result (assuming the die is a valid type)
func rollDie():
randomize()
var rolledNum
rolledNum = randi() % numFaces + 1
return rolledNum
#Returns the number of faces on this die
func getNumFaces():
return numFaces