Quote:
Originally posted by lordhelmut
Alright I need someone fairly good at scripting. I am trying to learn and I need a kinda mini tutorial here. Can someone take me through a short step by step process for scripting things like animals, baddies or anything with custom sprites. I kinda know something about u gotta make variables that deal with how many hearts and speed and such but thats about it. If someone is willing to help I would gladly appreciate it.
|
I'll help you out as much as I can. First, you'll need to either know the dimensions of the image (like the width/height of each sprite, and the starting x/y of each sprite so that they're the same size). Then, you'd need to set variables like:
this.hearts=heartcount;
this.speed=speed; (normal speed is about 0.2 or 0.3, can't remember which one).
Then, you'd need to do an if (created){} stuff, which sets the variables, and the image and junk. You'd use showimg, for showing it. Then, you'd need to use a changeimgvis index,3; (3 is the same level as the player on the board). Then you'd need changeimgpart index,x,y,width,height; (x and y are the starting x/y of the current sprite, and width and height are how many pixels to display following the starting x/y).
That's all jumbled together, I know, so if you have problems understanding it (I have a lot of trouble understanding some of the things I write sometimes), let me know, and I'll spend a little more time on this sort of thing. Or just ask someone else. Either one works.