Wednesday, February 24, 2010

Basic Scripting

I read through the chapter on scripting from that book I previously mentioned. He implements a simple, but very effective scripting system for characters. This allows me to chain animations, move the character's position on the map, setup dynamic animations based on user input and a lot more. He teaches by example, showing you how to setup an attack combination that requires the user to time some button presses in sequence. I played around with our hero character and made a fun, over-the-top, attack sequence hollywood style.







After seeing how useful scripting can be for characters, I thought it could be just as useful for maps. After some thought, I decided to try allowing up to 4 script commands to be entered per collision tile. I added script editing functionality to the map editor and whipped up a simple, but fun test using the "SetJump" script command.







I'm thinking I can use map scripting to handle lots of things such as energizing stations, save spots, doors to other maps, teleporting, event triggers, altering map data dynamically, etc. Besides this fun stuff, I fixed up tile collision a good deal. I added platform tiles you can jump from underneath and land on. I added a feature to the character editor to let you define a collision rectangle per character. Lastly, I added a feature to the map editor to cause any map segment piece you pick up to become the topmost piece. This will make it easier for us to hide segments behind other segments.

No comments:

Post a Comment