Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: I need some sprite rotating help...  (Read 748 times)

0 Members and 1 Guest are viewing this topic.
I need some sprite rotating help...
« on: September 12, 2007, 04:30:26 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Well, I am making the move from the Click Products to Game Maker.  I have to tell you, it's not easy when you understand
one system and are so accustomed to it and try to learn something else.
Anyway, so far, I have been using the built-in point-n-click event stuff in GM 6.1 Registered.

I want to know how to rotate an object's sprite every .01 second...
I won't care if it is code or built in because I'll have to learn GML some point in time.

An off-topic question:With built in functions, how do you stop the player's object when no buttons are pressed?
I tried the <No Key> function,but if the player is pushing the shoot button, then the player continues to move.
Also, how would I move in diagonals?

Sorry if this seems like alot.  I have the Game Maker's Apprentice book, but I lost my resource disk so I can't see
how to do alot of this stuff and I have not gotten to the diagonals or sprite rotating stuff yet.
« Last Edit: September 12, 2007, 04:34:20 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: I need some sprite rotating help...
« Reply #1 on: September 12, 2007, 05:24:02 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
I want to know how to rotate an object's sprite every .01 second...
Add this code in the step event of the object:
Code: [Select]
image_angle+=angles/room_speedOBS: replace "angles" by the number of angles the sprite rotates per second.

An off-topic question:With built in functions, how do you stop the player's object when no buttons are pressed?
I tried the <No Key> function,but if the player is pushing the shoot button, then the player continues to move.
EDIT2: Put that in the release key event for the movement keys (<up>, <down>, <left> and <right>).
(Check the next answer)

Also, how would I move in diagonals?
As you don't know GML, you usally move an object by clicking on that icon with 8 red arrows, right?
So instead, you'll click on the icon with blue arrows. There you set "direction" to the angle to where the object will go to.

EDIT: Ah, but you'd have to press two keys then...
So you do the following: Check "relative" in all movement actions, and in the release key event for the movement keys, use the same action (also with "relative" checked), but to the opposite direction.
« Last Edit: September 12, 2007, 05:46:40 pm by sjegtp »
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.11 seconds with 38 queries.

anything