Properly setting up Collision Boxes
Written and Converted by: Kyle_Katarn
Hey there, I'm here with my first tutorial and first post, actually. This may or may not have been mentioned on the forums (I haven't read through all the topics yet), so if you know how to do this, you can either bear with me or click away, either way I still get the view lol. ^_^
I've read through all the tutorials on this website, but I've noticed that none of them go into this in detail. This tutorial will also assume you've also got a project up and running with at least one player and map to test this on and will not teach you to do so, if you haven't. That is what the other tutorials are for. Okay, let's move on.
For this example, I'm going to be using a Buu's Fury Goku, ripped by Grim at the Sprite Database, put into an IGM friendly format by myself.
Okay, when you have an animation up and Running, you're going to want to look for a section in the Display Settings called Collision Detection with Walls (Tile), it looks like this:
Okay so we have a few Radio Buttons:
None - This animation has no colliding box and therefore can go through walls (theoretically, I haven't tested that theory out).
Detection On- This provides us with four boxes. The Position Boxes (top left and bottom left boxes) control the X and Y of your colliding box. This is done in percentages, so you'll have to tinker around with this until you find a good starting position.* The Size Boxes (top right and bottom right boxes) determine the width and height of your collision box. This is important, they also work in percentages, but they dont work as an X2 or Y2 position. Let me explain: if you had a frame that is 32x32, and you wanted a box in the bottom right of your frame, you wouldn't specify it as X = 50(%), Y = 50, W = 100(%), H = 100. The program would understand that as having another 32x32 box starting in the middle of the frame like so:
(The green box is your collision box)
What you would do in this situation is have the the width and height equal to half of the frame's total size (50%). That would give you a smaller box in the bottom-right of the frame.
Same as the Previous Frame - If you have a multiple frame animation, then this would only apply in the second, third, fourth etc. frames. It basically means that if you dont intend to have a colliding box that changes in size, you simply click this and it will take on the values of the frame before it.
* For better results when tinkering around with your collision box, you'll want to switch on, it will give you a visual representation of your collision boxes over your frame
Now, in the first frame of your animation, if you are working with the Goku, you'll want to set the X value to 34, Y value to 65, W to 32, H to 35. That makes a nice green box over the bottom half of him.
Since Goku's lower body doesnt move dramatically, you can use the "Same as the Previous Frame" for all the other frames in the animation (in fact, the whole sheet works with a 34, 65, 32, 35 box).
Now this green box is what will collide with your blocked tiles so you don't need to develop work-around's in the tiles, and I'll prove it.
This is the wall I'll be colliding with:
Viola, collided:
- View members tutorials/scripts
- ← Previous
- IG Maker
- Next →
Share:
Powered by (IM) Tutorials 1.1.0 © 2010, by Michael McCune