Skip to content

Commit

Permalink
Updated game box display
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkofmia committed Apr 24, 2020
1 parent 593011a commit c1535d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
32 changes: 31 additions & 1 deletion Control/logic/QuestionGeneratorChallenge.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var getHardQns

#Character
onready var userCharacter = get_tree().get_root().get_node("World").find_node("SelectedCharacter")
#Material
onready var texture = get_tree().get_root().get_node("World").find_node("Texture")

#For Primary
var qTextArr=[]
Expand Down Expand Up @@ -66,6 +68,7 @@ func _ready():
option4 = $MarginContainer/row/columnRight/Option4
setQns()
global.highscore = 0 #Reset Highscore
changeMaterial()#Change material of play board

func setQns(): #Set new set of Qns
#Hide Qn display
Expand Down Expand Up @@ -138,6 +141,32 @@ func setQns(): #Set new set of Qns
print("Performance Test: Challenge Mode Load Questions")
testPerformance.getTimeTaken()

#Change Box Material
func changeMaterial():
match global.worldSelected:#Check which world user is in and append color accordingly
"World #1":
texture.color = Color(0, 0, 0.8, 1)
"World #2":
texture.color = Color(0, 0.8, 0, 1)
"World #3":
texture.color = Color(0, 0.8, 0, 1)
"World #4":
texture.color = Color(0, 0, 0.8, 1)
"World #5":
texture.color = Color(0.3, 0.3, 0.3, 1)
"World #6":
texture.color = Color(0.8, 0.8, 0, 1)
"World #7":
texture.color = Color(0.8, 0, 0, 1)
"World #8": ###
texture.color = Color(1, 0, 0, 1)
"World #9":
texture.color = Color(0.3, 0.3, 0.3, 1)
"World #10":
texture.color = Color(0.8, 0.8, 0.8, 1)
_:
texture.color = Color(1, 1, 0, 1)

func resetQnArray(): #Resets the qn Array
#Primary Difficulty
qTextArr = []
Expand Down Expand Up @@ -167,6 +196,7 @@ func resetQnArray(): #Resets the qn Array
totalNoAdvQns = 0

func randomizeQuestion():
changeMaterial() #Change box display
#Get level
var blockTower = get_tree().get_root().get_node("World").find_node("BlockTower")
if is_instance_valid(blockTower):
Expand Down Expand Up @@ -271,7 +301,7 @@ func checkLevelTens(): #Check if the player reaches levels of ten
NextWorldBoard.show()
NextWorldBoard.find_node("Title").set_text("Level "+str(level)+" complete!")
self.hide()
userCharacter.addLife()
userCharacter.addLife()#Add 1 life after complete
if (level%25==0) and level!=0 :
var bossMode = get_tree().get_root().get_node("World").find_node("BossBoard")
bossMode.startBossMode()
Expand Down
4 changes: 2 additions & 2 deletions View/gameModes/ChallengePlayScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ position = Vector2( 35.9, -25.1528 )
scale = Vector2( 0.210295, 0.191248 )
frames = SubResource( 4 )
animation = "attack"
frame = 3
frame = 6
playing = true
flip_h = true

Expand Down Expand Up @@ -495,7 +495,7 @@ position = Vector2( 35.7768, -17.0161 )
scale = Vector2( 0.15, 0.15 )
frames = SubResource( 7 )
animation = "idle"
frame = 9
frame = 8
playing = true
flip_h = true
[connection signal="request_completed" from="GUI/PlayBoard/QuestionMenu/HTTPRequest" to="GUI/PlayBoard/QuestionMenu" method="_on_HTTPRequest_request_completed"]
Expand Down

0 comments on commit c1535d6

Please sign in to comment.