Central Games Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to do make this code in GML ?

2 posters

Go down

How to do make this code in GML ? Empty How to do make this code in GML ?

Post by zerugaze Fri Feb 20, 2009 10:51 pm

Check if the current x position of the player_obj is greater than half the sprite_width for the player_obj

subtract global.playerSpeed to the current x position of player_obj and store that value back inside the variable x for the player_obj
thanks

zerugaze
Newbie
Newbie

Number of posts : 3
Warning :
How to do make this code in GML ? Left_bar_bleue0 / 1000 / 100How to do make this code in GML ? Right_bar_bleue

Reputation :
How to do make this code in GML ? Left_bar_bleue0 / 1000 / 100How to do make this code in GML ? Right_bar_bleue

Registration date : 2009-02-20

Back to top Go down

How to do make this code in GML ? Empty Re: How to do make this code in GML ?

Post by im_not_emo Sat Feb 21, 2009 6:44 am

Code:
if(player_obj.x > (player_obj.sprite_width / 2))
{
 player_obj.x -= global.playerSpeed;
}

I think thats what you want

im_not_emo
Global Mod
Global Mod

Male
Number of posts : 896
Age : 31
Location : Auckland
Job/hobbies : Well, computer?
Warning :
How to do make this code in GML ? Left_bar_bleue0 / 1000 / 100How to do make this code in GML ? Right_bar_bleue

Reputation :
How to do make this code in GML ? Left_bar_bleue999 / 100999 / 100How to do make this code in GML ? Right_bar_bleue

Registration date : 2008-07-18

http://www.inegames.f33webhost.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum