Jump to content

Search the Community

Showing results for tags 'soulvampire'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. soulVampire

    Mr TwinkleToes

    have a moving platform created in the lvl, but need to create a collision area so the my player can stand on it, when i use the this.body.kinematic = false;, the platform can be moved out of the way, not what i wanted need to be able to jump on it removed the this .body.kinematic = false; from the code now can not interact with the platform in any way, so need to have a way to have a collision body so that can stand on object, but when add the kinematic the platform behaves in a way that is not what i want, the code for what i currently have is given below /** * moving platforms Entity */ game.MovingPlatformEntity = me.Sprite.extend( { init: function (x, y, settings) { // save the area size as defined in Tiled width = settings.width; // define this here instead of tiled settings.image = "platform_2"; // adjust the size setting information to match the sprite size // so that the entity object is created with the right size settings.framewidth = settings.width = 64; settings.frameheight = settings.height = 32; // call the parent constructor this._super(me.Sprite, 'init', [x, y , settings]); // add a physic body this.body = new me.Body(this); // turn off gravity this.body.gravity = 0; // add a default collision shape this.body.addShape(new me.Rect(0, 0, this.width, this.height)); // configure max speed and friction this.body.setMaxVelocity(settings.platform_movment_speed, 6); // set start/end position based on the initial area size x = this.pos.x; this.startX = x; this.pos.x = this.endX = x + width - this.width; //this.pos.x = x + width - this.width; // manually update the entity bounds as we manually change the position this.updateBounds(); // to remember which side we were walking this.platform_move_left = false; // make it "alive" this.alive = true; this.alwaysUpdate = true; }, // manage the enemy movement update : function (dt) { if (this.alive) { if (this.platform_move_left && this.pos.x <= this.startX) { this.platform_move_left = false; this.body.force.x = this.body.maxVel.x; } else if (!this.platform_move_left && this.pos.x >= this.endX) { this.platform_move_left = true; this.body.force.x = -this.body.maxVel.x; } } else { this.body.force.x = 0; } //this.renderable.flipX(this.walkLeft); // turn off gravity this.body.gravity = 0; // check & update movement this.body.update(dt); // handle collisions against other shapes me.collision.check(this); // return true if we moved or if the renderable was updated return (this._super(me.Sprite, 'update', [dt]) || this.body.vel.x !== 0 || this.body.vel.y !== 0); }, /** * colision handler * (called when colliding with other objects) */ onCollision : function (response, other) { }, });
×
×
  • Create New...