Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Game maker question!
United States
Yoshibro.
  Posted: Dec 11 2007, 12:57 AM
Quote Post


The adventures continue!
[*][*]

Group Icon
Group: Members
Posts: 237
Member No.: 4301
Joined: 24-August 07

Status: (0d) [--]


HIT HIT DECK! HEAD FOR THE HILLS! IT'S YET ANOTHER GAME MAKER QUESTION!
Now it's time to whip out your giant clubs of knowledge which you may smite me with!
I wish for some one to whack out he problem that I'm having with with the way game maker defines the direction in witch the object is facing.


(If you wish to know why I typed this paragraph in such a way lets just say I watch too much Beakman's World.)


--------------------
user posted image user posted image
[URL=
Top
United Kingdom
hazmeister
Posted: Dec 11 2007, 06:29 AM
Quote Post


ITT CATZ!!!
[*]

Group Icon
Group: Members
Posts: 1425
Member No.: 3802
Joined: 21-May 07

Status: (0d) [--]


For some reason direction 270 is down. I have no idea why.


--------------------
PMEmail PosterUsers WebsiteMSN
Top
United States
Yoshibro.
Posted: Dec 11 2007, 09:44 PM
Quote Post


The adventures continue!
[*][*]

Group Icon
Group: Members
Posts: 237
Member No.: 4301
Joined: 24-August 07

Status: (0d) [--]


No what I talking about is how does your object know where it's facing? Kind of like a virtual compass for your object.


--------------------
user posted image user posted image
[URL=
Top
Canada
Mewizkuit
Posted: Dec 11 2007, 09:50 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


QUOTE (Yoshibro. @ Dec 11 2007, 09:44 PM)
No what I talking about is how does your object know where it's facing? Kind of like a virtual compass for your object.

Just make it move in a direction at speed zero to choose a direction. That should work. If thats not what you mean, make a variable that is set when you choose a direction, and set the variable to whatever direction you are meant to be facing (ie 180 = left)


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
United States
TerabiteX
Posted: Dec 11 2007, 09:51 PM
Quote Post


Kirby :O
[*][*][*]

Group Icon
Group: Members
Posts: 1042
Member No.: 3043
Joined: 9-December 06

Status: (0d) [--]


If I understand your question correctly:

When you press right:
facing = 0
When you press left
facing = 180


--------------------

user posted image

I got myself a Youtube account. Check out my semi-awesome vids!

Want to send me a message? Send me one at Youtube, 'cause it's not going to get checked here for a while.

Current Projects:
Battle for the Mushroom Kingdom: On hold
Kirby Versus Shy Guy: On hold (Maybe cancelled??? I don't know)
Everything Else: Cancelled

Main refs: Ref 1(Makawee) Ref 1 Alternate(alex-rus07) Ref 2(hohoo)
Thanks to these people for drawing me!
I have been sprited by:
RKM 404_not_found Waluigi2 Joe__Inky11
PMEmail Poster
Top
United States
Elyk
Posted: Dec 11 2007, 09:51 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


you said compass...right?

point_direction(x1,y1,x2,y2)

This post has been edited by Elyk19 on Dec 11 2007, 09:51 PM
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Yoshibro.
Posted: Dec 11 2007, 10:55 PM
Quote Post


The adventures continue!
[*][*]

Group Icon
Group: Members
Posts: 237
Member No.: 4301
Joined: 24-August 07

Status: (0d) [--]


I have another question.
Does any of these thing work? Also where do I insert these codes?


--------------------
user posted image user posted image
[URL=
Top
United States
Mike Shinoda
Posted: Dec 11 2007, 11:26 PM
Quote Post


Aka Artic
[*][*]

Group Icon
Group: Members
Posts: 802
Member No.: 3598
Joined: 12-April 07

Status: (0d) [--]


QUOTE (Yoshibro. @ Dec 11 2007, 10:55 PM)
No what I talking about is how does your object know where it's facing? Kind of like a virtual compass for your object.

This is what I do:

Step 1: Create your sprites(ex. mario), but only facing right. Center the x point in the sprite origin.

Step 2: Create an "Execute code" in the step event. Open it.

Step 3: This is what you put in the code -->
if keyboard_check(vk_left)
image_xscale = -1
if keyboard_check(vk_right)
image_xscale = 1
//end

ALTERNATIVE: If you mean the way its facing (from a 0-360 degree scale) you need to use this:
image_angle = ?
replace ? with a number between 1-360. 0 being right, 90 being up, 180 being left, and 270 being down.THIS REQUIRE THE REG. VERSION

I've attached an open source(Directional.gmk) and an exe for those without gm7.

Attached File ( Number of downloads: 1 )
Attached File  Directional.zip


--------------------
rain.

AKA Artic

I'm gonna miss you ol' pal. See you guys in the 3.0.
PMEmail PosterUsers WebsiteIntegrity Messenger IMAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0984 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.63 ]