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: [Request]Draw sprite moving with a path.  (Read 1105 times)

0 Members and 1 Guest are viewing this topic.
[Request]Draw sprite moving with a path.
« on: September 08, 2007, 08:13:32 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
1.  I am wondering if there is any way that I could draw a sprite onto the screen, but with it, it also has an image speed. For example, I want to draw a coin onto the screen, and it also spins, while on the screen, and following the views.

2. Also, I want to know. if there is anyway that I could draw a sprite onto the screen, and have it moving on the screen(With a path), while still following the views.

Please and thank you!
-Mewgull
« Last Edit: September 09, 2007, 05:21:13 pm by Mewgull »
Logged
Re: [2 Requests]Draw sprite on the screen with a...
« Reply #1 on: September 08, 2007, 08:22:39 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
Yes. Just make the image_speed whatever you want, and then

draw_sprite(sprite_index,image_index,view_xview+#,view_yview+#);

# is how far right and down from the view you want to draw it.
Logged
Re: [2 Requests]Draw sprite on the screen with a...
« Reply #2 on: September 08, 2007, 09:30:30 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
I thought that would do it, but it wasn't very strong, so I didn't bother...
It worked! thank you.

Now for question 2
Logged
Re: [Request]Draw sprite moving.
« Reply #3 on: September 08, 2007, 09:39:44 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
Just replace the # with x and y and have the hspeed and vspeed changed in other pieces of code.
Logged
Re: [Request]Draw sprite moving.
« Reply #4 on: September 08, 2007, 09:42:58 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
Yes.

In the step event, use this code:

Code: [Select]
x = max(x,view_xview);
x = min(x,view_xview+view_wview);
y = max(y,view_yview);
y = min(y,view_yview+view_hview);
Which allows you to change positions but remain within the view. Just draw_sprite(sprite_index,image_index,x,y);
Logged
Re: [Request]Draw sprite moving.
« Reply #5 on: September 09, 2007, 05:20:45 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Thanks, but what I meant, and forgot to say, was, how could I do it with Paths?
Logged
Re: [Request]Draw sprite moving with a path.
« Reply #6 on: September 11, 2007, 07:57:33 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Bump -_-?
Logged
Pages: [1]   Go Up

 


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



Page created in 0.111 seconds with 51 queries.