Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] CreateText() issues

Author
Message
Nationalcrafter67
5
Years of Service
User Offline
Joined: 6th Oct 2018
Location:
Posted: 7th Mar 2019 07:40 Edited at: 7th Mar 2019 07:44
Hey guys, hoping to get some input on this. Here's how I have it written out

global highscore = 0
scr as integer

//scoring
if GetSpriteExists(3) = 0
CreateText(1,"Score:"+str(scr))
SetTextSize(1,35)
FixTextToScreen(1,1)
DeleteText(2)

endif

if GetSpriteExists(3) = 1
CreateText(2,"Highscore:" + str(highscore))
SetTextSize(2,35)
DeleteText(1)
FixTextToScreen(2,1)
sync()
endif


Whenever a collision box is triggered, the score is increased by 1, it works flawlessly when I use the Print() cmd, but fails to update the score, and highscore when using the CreateText() cmd. The second If statement here seems to be working fine as well, the Highscore is updated, and is ultimately saved and updated if there is a new highscore detected.

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Mar 2019 12:07 Edited at: 7th Mar 2019 12:08
This post has been marked by the post author as the answer.
use this at the beginning of your code


use this command to update the score
fubar
Nationalcrafter67
5
Years of Service
User Offline
Joined: 6th Oct 2018
Location:
Posted: 7th Mar 2019 17:39
The champion! Thanks Adelaide.

Login to post a reply

Server time is: 2024-04-24 15:52:16
Your offset time is: 2024-04-24 15:52:16