Posted September 11, 2012
Hi,
I'm currently trying to redo a game I made a long time ago in Game Maker, using a simple platform engine I made more recently, but I'm having a bit of trouble with creating elevators.
Basically, I want it to check if the player is a certain distance from the elevator, and if the player is within that distance then it will check to see if the action key is being pressed, then, if it is then it will check to see what position it is in via a variable, and if it is in position 1 then it will go down, and 2 it will go up. I know how to do most of that, I am just having trouble with one section - here is my code:
if distance_to_object(obj_player)<10;
{
if keyboard_check_pressed(vk_control)if variable elev_position=1
}
then vspeed = 2
else
I still got to add the variable check, but it keeps telling me that then is an 'Unexpected symbol in expression"
Is there something wrong with my formatting, or the code itself?
Thanks
sv
I'm currently trying to redo a game I made a long time ago in Game Maker, using a simple platform engine I made more recently, but I'm having a bit of trouble with creating elevators.
Basically, I want it to check if the player is a certain distance from the elevator, and if the player is within that distance then it will check to see if the action key is being pressed, then, if it is then it will check to see what position it is in via a variable, and if it is in position 1 then it will go down, and 2 it will go up. I know how to do most of that, I am just having trouble with one section - here is my code:
if distance_to_object(obj_player)<10;
{
if keyboard_check_pressed(vk_control)if variable elev_position=1
}
then vspeed = 2
else
I still got to add the variable check, but it keeps telling me that then is an 'Unexpected symbol in expression"
Is there something wrong with my formatting, or the code itself?
Thanks
sv
This question / problem has been solved by SCPM
