123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|603|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> PC Gaming -> Flash Collision checking?

Thu, 24 Dec 2009, 09:33
CodersRule
Hi.
I'm trying to check collisions for my flash sidescroller.
I'm using code from my book, Game Programming with Flash for Dummies.
I have 4 layers:
-landmap (The black-and-white map of the land that's used for collision checking)
-colorland (the screen the the user sees)
-guy (the guy that you control)
-actions (actions)

The way the code currently deals with collisions, is it makes the y-axis direction of the character 0 (stops going up or down) and ceases the jump variable.

This _would_ work fine, but when you collide with a platform on the x axis, nothing happens- you can walk right through it.

I can't change the x direction of the character to 0 on collision, because then when they collide with the ground, they can't move left or right- they have to jump to move.

Basically, all I'm trying to do is set collisions with a black-and-white map. How should I?

I can provide the fla file if needed.
Thu, 24 Dec 2009, 09:38
Jayenkai
First do the Y collision, and move the player up above the floor, and THEN do the X collision, once he's no longer going to hit against the floor.

-=-=-
''Load, Next List!''
Thu, 24 Dec 2009, 09:40
CodersRule
No matter how many times I try to comprehend that...
I don't get it.
What?
Thu, 24 Dec 2009, 09:50
CodersRule
Here's the fla.
My Scroller
Thu, 24 Dec 2009, 11:26
Jayenkai
fla's no good to me. I haven't paid the £791,000 you need to pay for flash.

-=-=-
''Load, Next List!''