torsdag 25. november 2010

Case 5, Hills and Pistols and somthing called sprite

This week I will not only make a hill for my pirate to walk up and down, I will not only make a hill for my pirate to walk up and down AND a pistol that he can pick up if he feels like it, I will also make a sprite. After confusing moments with lots of stupid questions, I have now figured out what a sprite is. A sprite is a movieclip in flash that contains other movieclips, sort of like a car with people in it. You have to open the door in case to get the people inside and you have to know which door to open in order to get the right person from the car. You do not, as an example, want to drag the driver out of the car on a highway in the middle of a turn while the man in the passengerseat is paralyzed from the waist and up and will not be able to grab hold of the wheel. To be honest I just made that up, but I must admit it sounds kind of reasonable. If I am wrong, the clock IS 07.12 AM in the time of writing. And not in the morning, in the night. Anyways, I put my 5 character animations in the same movieclip, and found myself using a great deal of time understanding how to get these people out from the car. In no way do I find this efficient, but I believe it is absolutely necesseray to maintain a little pit of structure in the script. I have, by the way, not yet been very structured in my use of scripts, but this is something that later will be applied when my understandig for the script increases. The pistol i so carefully has drawn to make it look lik a magnum now dissapears when I touch it. The pirates anchorpoint hittests against its filling. If it hits, then the pistol removechilds. Easy peasy. When someone sits next to you and tells you how to do it. And as for the levitation in the terrain, I also used a hittest. Every time it hits, the pirate's y-value raises by one. I also added som gravity, since it can't really hittest against a little mountain, when he is on top of it and he is walking down. So I solved this case in a most satisfying way for my own sake. Not a whole lot of expectations to my programming skills yet but it will only get better in time.

Ingen kommentarer:

Legg inn en kommentar