• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker (Solved) Early tutorial problem

B

Bigheadface

Guest
Hi, I just downloaded GMS2 free version today. Checking it out to decide which engine to buy for my son's birthday. I'm very new to coding so please bear with me.

I'm in part 5 of the yoyo games youtube tutorial. I've completed all of the tasks and set the score to draw at the top center of the screen. I've watched the video twice and I'm fairly sure (though not certain) that I've typed all of the code he's included exactly as he shows on his screen.

Unfortunately when I try to test the game, I get this fatal error:

upload_2017-3-14_14-53-12.png

Text is:


___________________________________________
###########################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_score:

Variable obj_score.cy(100006, -2147483648) not set before reading it.
at gml_Object_obj_score_Draw_0 (line 5) - draw_text (cx+cw/2,cy+25,string(thescore));
###########################################

and code is:

upload_2017-3-14_14-54-11.png

I don't know what I've done wrong. Can anyone help me figure out why I'm getting this fatal error?
 

chamaeleon

Member
There is no var cy = ... in that code, like there is for cx.. As the message indicates, obj_score.cy is not set. And from the context, it looks like there should be. Is xy a misspelled cy?
 
B

Bigheadface

Guest
oh jeez Louise....

Thanks Chamaeleon!....I feel stupid now
 
B

Bigheadface

Guest
And now I know a part of the error to pay closer attention to for the next time I get an error...hopefully I'll be able to solve it on my own next time.
 
Top