• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code help with "while"

N

not_the_fbi

Guest
hi! i'm new to gamemaker and i might just have been an idiot here but in line 5 position 6 it says there is and unexpected symbol please help!

if (place_meeting(x+hspd, y, obj_wall)) (
while (place_meeting(x+sign(hspd), y, obj_wall)) (
x+=sign(hspd);
)
hspd = 0;
)

x+=hspd;
 

chamaeleon

Member
Parenthesis is not the same as braces. If you have not studied the GML overview section in the manual yet, I strongly recommend you do so. Also, I strongly recommend getting acquainted with the event model implemented by GMS, the difference between Objects and Instances, and the categories of functions in the GML reference (categories to begin with, not learning all of the functions within them at once, in order to understand what kinds of tools you may have at your disposal, and as you dive deeper, explore a category at a time to solve specific problems).
 
Top