Jump to content

Search the Community

Showing results for tags 'collision detection line'.

  • 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. Hi Community! I try to draw a line which follows the angle of my cursor. It shouldn't stop at my cursor but rather follow its direction until a collision happens. As for now I am able to draw the line on every update which follows perfectly my cursor, but stops then. I had the idea to "fire" a sensor (trigger) along the line to check when a collision happens. My goal is to archieve this effect with p2js. create(){game.input.addMoveCallback(move, this);} function draw(){ bmd.clear(); bmd.ctx.beginPath(); bmd.ctx.beginPath(); bmd.ctx.moveTo(ship.x, ship.y); bmd.ctx.lineTo(game.input.x , game.input.y); bmd.ctx.lineWidth = 4; bmd.ctx.stroke(); bmd.ctx.closePath(); bmd.render(); }function move(pointer, x, y, isDown) { mouseBody.body.x= x; mouseBody.body.y= y; }function update() { draw(); }
×
×
  • Create New...