Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Sprite angles
Unspecified
#9619;#9565;
Posted: Jun 14 2008, 06:25 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 250
Member No.: 2497
Joined: 15-August 06

Status: (0d) [--]


How would I make a sprite's angle change depending on whereMario is (i.e if mario is above it, its angle with be facing upwards ect..).

I don't have the sprite_angle/image_angle function.

GM 5.3

Sprite is a two frame animation.


--------------------
user posted image
PMEmail Poster
Top
United States
Elyk
Posted: Jun 14 2008, 07:37 PM
Quote Post


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

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

Status: (0d) [--]


you could rotate it yourself in one sprite

as in have about 20 different images in the sprite, each at a seperate angle

then rather than image_angle use image_index=direction/18(assuming there are 20 images, if there were 10 you would divide by 36, 5 you would divide by 64, etc)


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
#9619;#9565;
Posted: Jun 14 2008, 07:45 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 250
Member No.: 2497
Joined: 15-August 06

Status: (0d) [--]


I have tried that already but the animation would not since it would be set to one index.

I used image_single though is there a difference?


--------------------
user posted image
PMEmail Poster
Top
Unspecified
Miaxis
Posted: Jun 15 2008, 04:14 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


step event

move_towards_point(mario.x,mario.y,1)
hspeed-=hspeed
vspeed-=vspeed
image_angle=direction


Make sure the sprite used faces the right.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Sweden
JosJuice
Posted: Jun 15 2008, 05:39 AM
Quote Post


Threw an apple at Caterpie! It's a good pizza topping
[*][*]

Group Icon
Group: Members
Posts: 318
Member No.: 4596
Joined: 19-October 07

Status: (0d) [--]


QUOTE (Latia @ Jun 15 2008, 11:14 AM)
step event

move_towards_point(mario.x,mario.y,1)
hspeed-=hspeed
vspeed-=vspeed
image_angle=direction


Make sure the sprite used faces the right.

QUOTE
I don't have the sprite_angle/image_angle function.


--------------------
user posted image
QUOTE (Darkyoshi @ Dec 19 2008, 05:09 PM)
I remading it to make a Free-Glitch version
QUOTE (Keyser Soze @ Dec 21 2008, 12:28 AM)
Thank god I thought I was going to have to PAY for my glitches!

user posted image
QUOTE
You know what they say toast is toast. ;3
PM
Top
Unspecified
Miaxis
Posted: Jun 15 2008, 05:59 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


rotate your sprite in 32 degrees

create event
image_speed=0
step event

move_towards_point(mario.x,mario.y,1)
hspeed-=hspeed
vspeed-=vspeed
image_index=direction/10


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
United States
Elyk
Posted: Jun 15 2008, 10:21 AM
Quote Post


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

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

Status: (0d) [--]


Latia, do you know how to read topics?


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
Miaxis
Posted: Jun 15 2008, 10:37 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


And whatīs wrong with it THIS TIME?


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
United States
Elyk
Posted: Jun 15 2008, 10:42 AM
Quote Post


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

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

Status: (0d) [--]


QUOTE (Latia @ Jun 15 2008, 11:37 AM)
And whatīs wrong with it THIS TIME?

If you read you would know :/


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
#9619;#9565;
Posted: Jun 15 2008, 11:27 AM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 250
Member No.: 2497
Joined: 15-August 06

Status: (0d) [--]


QUOTE (Latia @ Jun 15 2008, 05:59 AM)
rotate your sprite in 32 degrees

create event
image_speed=0
step event

move_towards_point(mario.x,mario.y,1)
hspeed-=hspeed
vspeed-=vspeed
image_index=direction/10

Hrmm it doesn't work, if I set the speed to 1 in the move_towards_point fnction, it doesn't chnage angle at all. If I set the speed to 0, it will go up to 90 degress but the animation won't work.


--------------------
user posted image
PMEmail Poster
Top
Unspecified
Miaxis
Posted: Jun 15 2008, 11:28 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


QUOTE
have tried that already but the animation would not since it would be set to one index.

I used image_single though is there a difference?

Okay....actually I didnīt answer that question.......so yes,there IS a difference,use image_index.
There ya go Elyk.:P


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Japan
Soiyeruda
Posted: Jun 15 2008, 11:30 AM
Quote Post


Because retarded looking women is fun. :S
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3589
Member No.: 5004
Joined: 6-March 08

Status: (0d) [--]


QUOTE (#9619;#9565; @ Jun 14 2008, 07:45 PM)
I have tried that already but the animation would not since it would be set to one index.

I used image_single though is there a difference?

image_index simply changes the image of the sprite.

image_single changes the image of the sprite and the image speed is 0

If you did this with image_index:

CODE
image_speed=1
image_index=1


Then it will still cycle through the images.

Basically

CODE
image_single=1


Is the same as

CODE
image_speed=0
image_index=1
PMEmail Poster
Top
United States
Elyk
Posted: Jun 15 2008, 11:55 AM
Quote Post


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

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

Status: (0d) [--]


QUOTE (Latia @ Jun 15 2008, 12:28 PM)
There ya go Elyk.:P

I meant that I already gave him both the answers you did, and he said neither worked.


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
Miaxis
Posted: Jun 15 2008, 12:00 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Oh, k. Actually he should get it to work, since my sidekick Soiyeruda explained it pretty good.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
#9619;#9565;
Posted: Jun 15 2008, 12:01 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 250
Member No.: 2497
Joined: 15-August 06

Status: (0d) [--]


QUOTE (Elyk @ Jun 15 2008, 11:55 AM)
I meant that I already gave him both the answers you did, and he said neither worked.

Yeah, I even came up with an alternative but it still wont work.

I have a seperate sprite for a few different angles (right now im using 2 different, 0 and 45).

CODE
if object_exists(Mario) and instance_find(Mario,0) and x>view_left and x<view_left[0]+320
{
if mydirection="left" and Mario.y<y-32 {sprite_index=piranah_left2}
if mydirection="left" and Mario.y<y+16 {sprite_index=piranah_left}
if mydirection="right" and Mario.y<y-32 {sprite_index=piranah_right2}
if mydirection="right" and Mario.y<y+16 {sprite_index=piranah_right}
sound_play(sopiranah)
image_speed=0.5
}


it goes like that for now, I tried rearrangine the y<y stuff like 10 times but nothing works. =/

Even this

CODE
if object_exists(Mario) and instance_find(Mario,0) and x>view_left and x<view_left[0]+320
{
if mydirection="left" and y<Mario.y {sprite_index=piranah_left2}
if mydirection="left" and y>Mario.y {sprite_index=piranah_left}
if mydirection="right" and y<Mario.y {sprite_index=piranah_right2}
if mydirection="right" and y>Mario.y {sprite_index=piranah_right}
sound_play(sopiranah)
}


I would prefer the sprite rotaing like before, but none seem to work.


--------------------
user posted image
PMEmail Poster
Top
Unspecified
#9619;#9565;
Posted: Jun 15 2008, 12:02 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 250
Member No.: 2497
Joined: 15-August 06

Status: (0d) [--]


QUOTE (Latia @ Jun 15 2008, 12:00 PM)
Oh, k. Actually he should get it to work, since my sidekick Soiyeruda explained it pretty good.

I tried what Soiyeruda said but it didn't change nything.


--------------------
user posted image
PMEmail Poster
Top
Japan
Soiyeruda
Posted: Jun 15 2008, 02:40 PM
Quote Post


Because retarded looking women is fun. :S
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3589
Member No.: 5004
Joined: 6-March 08

Status: (0d) [--]


I can't really help you much further, considering you are using 5.3 and I use 7.0.
Sorry.
PMEmail Poster
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.0915 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.19 ]