Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by harryfeng

http://littleroom.ca/zxc/gotstyle/

check the game. so each floor is a collision so entities can walk on it.

but I want to make the plant fall off the building after the player hit it.

how do I make it happen?

1 decade ago by harryfeng

oh, press space to skip the entro screen.

1 decade ago by ArcadeHype

Box2D physics would be your best bet.

1 decade ago by StuartTresadern

If you just want the plants to drop through the floors when the Player hits them, override the update on your plant entity when the Player hits the plant.In effect stopping the trace against the collision map. Not sure Box2D would be any better as you would still Need the same sort of logic !.

Setup a property
hit:false

override update

            update:function(){
                
                if(this.hit==true) {
                    this.pos.x += this.vel.x * ig.system.tick;
                    this.pos.y += this.vel.y * ig.system.tick;
                }
                else {
                    this.parent( );
                }

            },

and Change the state of hit in the plants check

 check:function(other){
                this.parent(other);
                if (other instanceof EntityPlayer){

                    this.hit=true;
                   

                }
            }
Page 1 of 1
« first « previous next › last »