Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Can someone teach me Sprite Functions?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Tue Feb 10, 2009 5:23 pm    Post subject: Can someone teach me Sprite Functions? Reply with quote

Okay, so I spent some time trying to understand Slices and I realized after a while that I didn't really need to use them (not to mention that it was too much of a headache to learn >_<).

I just want to place an explosion, made of two large enemy sprites onto the screen.

So I thought I would want something like:

Code:

  set variable (Fire 1, load large enemy sprite (0))
  set variable (Fire 2, load large enemy sprite (1))
 
  free sprite(Fire 1)
  free sprite(Fire 2)
 
  place sprite (Fire 1, 67, -32)
  place sprite (Fire 2, 71, 20)
 
  set sprite visible (Fire 1, on)
  set sprite visible (Fire 2, on)

  #Animation ends and it's time for the fire to go away.

  set sprite visible (Fire 1, off)
  set sprite visible (Fire 2, off)


A point at the error or a tutorial would be greatly appreciated.

[edit]

Also, what do I do with the 'Screen Layouts' in Custom?
Whenever I set sprites up in there, they get cleared on a 'Whenever-Custom-Feels-Like-It' bases :/
Back to top
View user's profile Send private message Send e-mail AIM Address
Calehay
...yeah.
Class B Minstrel



Joined: 07 Jul 2004
Posts: 549

PostPosted: Tue Feb 10, 2009 5:36 pm    Post subject: Reply with quote

Remove the freesprite commands. Freesprite is removing the enemy sprite you loaded in the previous two lines, making it look like nothing is happening. You could also remove the lines where you set the fire's visibility to on. When you load a sprite, it is on by default.

Quote:
Also, what do I do with the 'Screen Layouts' in Custom?
Whenever I set sprites up in there, they get cleared on a 'Whenever-Custom-Feels-Like-It' bases :/


You can't do anything with it yet except test out layouts. From what I hear, eventually this menu will allow us to modify the layouts of the menu screens and create our own layouts that we can load using plotscripting.
_________________
Calehay
Back to top
View user's profile Send private message AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Tue Feb 10, 2009 5:40 pm    Post subject: Reply with quote

Quote:
Remove the freesprite commands. Freesprite is removing the enemy sprite you loaded in the previous two lines, making it look like nothing is happening. You could also remove the lines where you set the fire's visibility to on. When you load a sprite, it is on by default.


Oh hey, it works perfectly.

Thanks for the quick response.
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Feb 10, 2009 8:51 pm    Post subject: Re: Can someone teach me Sprite Functions? Reply with quote

You don't need to mess with sprite visibility either, since the sprites start visible when they are loaded, and freeing them makes them go away.

Code:

  Fire 1 := load large enemy sprite (0)
  Fire 2 := load large enemy sprite (1)
 
  place sprite (Fire 1, 67, -32)
  place sprite (Fire 2, 71, 20)
 
  #Animation ends and it's time for the fire to go away.

  free sprite (Fire 1)
  free sprite (Fire 2)


Also, the "set variable" command is starting to drive me crazy :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Tue Feb 10, 2009 9:09 pm    Post subject: Reply with quote

Quote:
You don't need to mess with sprite visibility either, since the sprites start visible when they are loaded, and freeing them makes them go away.

Oh, the definition seemed kind of weird to me.
Quote:
By default, a sprite is invisible (on), and must be made visible (off) only if you want to hide it.

Actually, the definition is pretty odd.

Quote:
Also, the "set variable" command is starting to drive me crazy Happy


It's just become a habit for me :/
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Feb 10, 2009 9:24 pm    Post subject: Reply with quote

TwinHamster wrote:
Actually, the definition is pretty odd.


Oops! The definition is totally wrong! When I changed it to start newly loaded sprites as visible I forgot to update the documentation! I'll fix it.

TwinHamster wrote:
It's just become a habit for me :/


Eh, that's okay. I'm just saying it drives me crazy, that doesn't mean it has to drive you crazy :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Feb 11, 2009 12:05 am    Post subject: Reply with quote

James Paige wrote:
TwinHamster wrote:
It's just become a habit for me :/


Eh, that's okay. I'm just saying it drives me crazy, that doesn't mean it has to drive you crazy :)


Well it's driving me crazy too! Dang users!
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Feb 11, 2009 8:09 am    Post subject: Reply with quote

The Mad Cacti wrote:
James Paige wrote:
TwinHamster wrote:
It's just become a habit for me :/


Eh, that's okay. I'm just saying it drives me crazy, that doesn't mean it has to drive you crazy :)


Well it's driving me crazy too! Dang users!


I know! This program would be so much easier to maintain and upgrade if nobody ever actually used it >:)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group