Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- critterAnimate(x,y)
- {
- if( this.validatePosition(x,y) === 0 ) { return 0; }
- let direction = this.validateMove(x,y);
- if( direction === 0 ) { return 0; }
- this.hasit[x][y] = 1;
- this.hadit[x][y] = 1;
- this.x1 = x;
- this.y1 = y;
- this.x2 = x + this.cardinals[direction][this.i.x];
- this.y2 = y + this.cardinals[direction][this.i.y];
- this.mapPull ( );
- let attribute = this.critter;
- let result = 0;
- let attr = this.section(this.src[attribute],0);
- let action = this.section("move",0);
- if ( attr !== this.section(``) ) {
- let functionName = `${this.attributes[attribute]}_${attr}_${action}`;
- result = this.callAttributeFunction ( functionName );
- this.alibi ( result );
- // view_swap ( );
- }
- switch ( result )
- {
- case 1:
- this.mapPush ( );
- this.hasit[this.x1][this.y1] = 0;
- this.hadit[this.x1][this.y1] = 1;
- this.hasit[this.x2][this.y2] = 1;
- this.hadit[this.x2][this.y2] = 1;
- return result;
- break;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement