Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: http://gameml.iowoi.org/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com
Keywords


Facing Toward Character? Please Help!

View previous topic View next topic Go down

Facing Toward Character? Please Help!

Post by -js1210- on Sun Jun 07, 2009 11:38 am

How do you make it so that something faces a character? For instance if Samus was on the right side of the boss it faces right. If she moves to the left side it changes to the left in order to face towards her again.

Please help.
avatar
-js1210-
Super 500 GML
Super 500 GML

Posts : 1298
Points : 32702
GameML Reputation : 27
Join date : 2009-06-02
Age : 22
Location : United States

View user profile http://www.yoyogames.com/members/js1210

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by 3d on Sun Jun 07, 2009 11:49 am

image_index=point_direction (x,y,playerobjectname.x,playerobjectname.y)

make two images of a right and left sprite in the sprite.

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42336
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by -js1210- on Sun Jun 07, 2009 11:51 am

Thank you very much 3d!
avatar
-js1210-
Super 500 GML
Super 500 GML

Posts : 1298
Points : 32702
GameML Reputation : 27
Join date : 2009-06-02
Age : 22
Location : United States

View user profile http://www.yoyogames.com/members/js1210

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by 3d on Sun Jun 07, 2009 11:59 am

i think itll work.

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42336
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by Time on Sun Jun 07, 2009 6:48 pm

I think a better way of doing this would be this (not sure if this requires pro...):
Code:
image_xscale = playerobjectname.x > x;
Make the sprite facing right (with as many subimages as you want) to make this work.

Without pro, I would use this:
Code:
image_index = playerobjectname.x > x;
...Where the first image of the sprite is facing left and the second is facing right.
avatar
Time
GameML Noob
GameML Noob

Posts : 22
Points : 30661
GameML Reputation : 3
Join date : 2009-06-01
Age : 24

View user profile

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by 3d on Sun Jun 07, 2009 7:22 pm

that works beta

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42336
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Facing Toward Character? Please Help!

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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