home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.Sprite;
-
- [Embed(source="/_assets/assets.swf", symbol="Block")]
- public class Block extends Sprite
- {
-
-
- public function Block()
- {
- super();
- x = Math.random() * 720;
- y = Math.random() * 480;
- width = 22 + Math.random() * 70;
- height = 22 + Math.random() * 70;
- }
-
- internal function collision(param1:Actor) : *
- {
- var _loc2_:int = 0;
- while(hitTestObject(param1) && _loc2_ < 50)
- {
- _loc2_++;
- if(param1.velx != 0 || param1 is Zombie)
- {
- if(param1.x < x)
- {
- --param1.x;
- }
- if(param1.x > x)
- {
- ++param1.x;
- }
- }
- if(param1.vely != 0 || param1 is Zombie)
- {
- if(param1.y < y)
- {
- --param1.y;
- }
- if(param1.y > y)
- {
- ++param1.y;
- }
- }
- if(param1.velx == 0 && param1.vely == 0)
- {
- ++param1.x;
- ++param1.y;
- }
- }
- }
- }
- }
-