Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411658 Posts in 69395 Topics- by 58451 Members - Latest Member: Monkey Nuts

May 15, 2024, 09:42:43 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)shooting question...
Pages: [1]
Print
Author Topic: shooting question...  (Read 1137 times)
Cocytus79
Level 0
***


Pathetic man-child


View Profile WWW
« on: April 04, 2010, 06:20:47 PM »

 Hey guys, I have kinda a dumb Game Maker question.

As you may or may not know,I just finished my first game. All well and good, but to achieve my character animating I just made a ton of objects of the character moving in each direction because I didn't realize there was a "change sprite" drag n' drop option.

So I realized i could just change sprites for each direction instead of having different objects for each direction. AWESOME ! Problem is, how do I get my character to shoot in the direction he is facing without having different "objects" for each direction.

I'm sorry to bother you fellows with dumb GM questions, but this has been gnawing on my mind all day and none of the tutorials I consult seem to approach this specific question in terms I quite understand.
« Last Edit: April 04, 2010, 06:47:08 PM by Cocytus79 » Logged
oahda
Level 10
*****



View Profile
« Reply #1 on: April 04, 2010, 08:12:23 PM »

When you shoot, do something like:

Code:
bullet = instance_create(0,0,nameOfYourBulletObject);
bullet.direction = direction;

This will set the direction of the bullet to that of your character (if you are using GM's built in direction variable for the character's direction).

Also, this is posted in the wrong section.
Logged

Cocytus79
Level 0
***


Pathetic man-child


View Profile WWW
« Reply #2 on: April 04, 2010, 08:17:56 PM »

Ah, thanks for the help.

Also, my apologies about being in the wrong forum. Embarrassed  Sadly, it will not let me delete post in this sub-forum.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic