Search the Community

Showing results for tags 'Physics'.



More search options

  • 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 Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

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 668 results

  1. Hello everyone, I started using Phaser today and I must say I am impressed. Well done guys! I made a simple image rotate and move towards the mouse, as explained in the examples "accelerate to pointer" and "move towards object". What happens though is that when that image collides with the mouse (meaning image coordinates = mouse coordinates) the image stops and starts trembling awkwardly. Any way to make it stop facing the last position before colliding? My code: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload() { game.load.image('player', 'assets/player.png');}function create() { player = game.add.sprite(400, 300, 'player'); player.anchor.setTo(0.5, 0.5);}function update() { if (game.physics.collide(player, this.game.input.activePointer.circle)) { player.velocity.x = 0; player.velocity.y = 0; } else { player.rotation = game.physics.moveToPointer(player, 60, this.game.input.activePointer); }}Thanks!
  2. Play Now It's christmas already?! Santa was a bit late in collecting the gifts. Will you help him? In this physics puzzle game you try to reach the gift to santa's bag , You should make carful moves on which ropes to cut or which objects you shoot with the slingshot , The point is , Collect the gifts! Screenshots: --
  3. Send Watermelon Home Update -20 levels added -removed the possibility to pick up and move the watermelon in a box!(now you can not cheat ) -Now if you fell a stone box that level can not go any further! -enhanced game difficulty! -added Walkthrough Description Be smart, show what you can do! Complete 30 levels and send home a watermelon! ScreenShots Controls "how to play" is on the first level. Game Link: http://megga.comule.com/swh5/ Walkthrough
  4. I noticed some odd behaviour of sprite bodies. If I take a sprite, set visible to false and start moving it around while rendering the body with game.debug.renderSpriteBody, the body will actually stay where it was. This is especially strange when I use kill to temporarily depose of a sprite, because the body will still be present in the game. This lead to two bugs in my project: 1. My invisible enemies are now almost impossible to hit, because they don't carry their bodies with them 2. Somehow the body of my projectile is able to collide on it's last position, when I used reset after using kill. I was not able to reproduce this in the examples, so I don't know what strange factor is contributing to that. I destroy my projectile now so this doesn't happen, though I would have liked to reuse it. The invisible enemies could be achieved with empty frames, but I don't like that solution either. So basically I want to know if this is supposed to happen and if so, how I could implement enemies that can turn invisible without needing an empty frame in their spritesheet.
  5. Hey all, Got some motivation to continue working on my 'Tiny Wings' inspired game. Finally got some decent performance: 40-60fps on iOS.15-20 fps on the stock Android browser. Could improve this though Things I had do to get there: Use Chipmunk rather than Box2dHalve the resolution to 240x160Use a limited pool of 'ground' strips to represent the ground vertex points http://www.tysonross.com/temp/tinywingsclone/index.html Going to add some collectable coins, different 'islands', and basically make it a proper game. Cheers, Tyson
  6. Is there any possibility to shrink the physics body in Phaser? My game relies on collisions a lot. Round or polygonal body would be perfect. But if I can at least shrink the body, it will help a lot.
  7. Hello. I'm working on top-down 8 ball pool game. Box2D world has 0 gravity and when I use ApplyImpulse on ball it won't slow down and never stops. My question is how to apply friction for top down game? You can test it here: http://impressive.lt/test/box2d/8ball.html Source code: <html> <head> <title>8ball</title> </head> <body onload="init();"> <canvas id="canvas" width="600" height="400" style="background-color:#333333;" ></canvas> </body> <script type="text/javascript" src="Box2dWeb-2.1.a.3.min.js"></script> <script type="text/javascript"> function init() { var b2Vec2 = Box2D.Common.Math.b2Vec2 , b2AABB = Box2D.Collision.b2AABB , b2BodyDef = Box2D.Dynamics.b2BodyDef , b2Body = Box2D.Dynamics.b2Body , b2FixtureDef = Box2D.Dynamics.b2FixtureDef , b2Fixture = Box2D.Dynamics.b2Fixture , b2World = Box2D.Dynamics.b2World , b2MassData = Box2D.Collision.Shapes.b2MassData , b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape , b2CircleShape = Box2D.Collision.Shapes.b2CircleShape , b2DebugDraw = Box2D.Dynamics.b2DebugDraw , b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef ; var world = new b2World( new b2Vec2(0, 0) //gravity , true //allow sleep ); function borders(){ var borderFix = new b2FixtureDef; borderFix.density = 1.0; borderFix.friction = 0.5; borderFix.restitution = 0.2; borderFix.shape = new b2PolygonShape; borderFix.shape.SetAsBox(20, 2); var borderBody = new b2BodyDef; borderBody.type = b2Body.b2_staticBody; borderBody.position.Set(10, 400 / 30 + 1.8); world.CreateBody(borderBody).CreateFixture(borderFix); borderBody.position.Set(10, -1.8); world.CreateBody(borderBody).CreateFixture(borderFix); borderFix.shape.SetAsBox(2, 14); borderBody.position.Set(-1.8, 13); world.CreateBody(borderBody).CreateFixture(borderFix); borderBody.position.Set(21.8, 13); world.CreateBody(borderBody).CreateFixture(borderFix); } function balls(){ var cue, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; var ballFix = new b2FixtureDef; ballFix.density = 1.0; ballFix.friction = 0.5; ballFix.restitution = 0.2; var ballBody = new b2BodyDef; ballBody.type = b2Body.b2_dynamicBody; ballFix.shape = new b2CircleShape(0.4); ballBody.position.x = Math.random() * 10; ballBody.position.y = Math.random() * 10; var ball = world.CreateBody(ballBody).CreateFixture(ballFix); ball.GetBody().ApplyImpulse(new b2Vec2(1,0), new b2Vec2(0,0)); } var debugDraw = new b2DebugDraw(); debugDraw.SetSprite(document.getElementById("canvas").getContext("2d")); debugDraw.SetDrawScale(30.0); debugDraw.SetFillAlpha(0.5); debugDraw.SetLineThickness(1.0); debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit); world.SetDebugDraw(debugDraw); window.setInterval(update, 1000 / 60); function update() { world.Step(1 / 60, 10, 10); world.DrawDebugData(); world.ClearForces(); }; borders(); balls(); }; </script> </html>
  8. A new PlayCanvas tutorial has just gone live: Collision and Trigger Volumes. Check it out: http://developer.playcanvas.com/tutorials/intermediate/collision_and_triggers.html Trigger volumes in particular are so incredibly useful when writing a game. Imagine determining if a car has driven through a checkpoint or whether a character has stepped on a trap. Trigger volumes notify you when these events occur. Enjoy!
  9. Hi all! I've just registered to this forum, and I'm very new to make HTML5 games. I want to show you this game that I made with GameMaker: Studio, it's called Basketball Touch. PLAY IT ON MOBILE Basketball Touch is a very simple HTML5 game optimized for mobile, based on physics. The object of the game is to score as many baskets as you can in two minutes. There is a score multiplier, which is incremented when you score a basket, but it will be reset to 1 in few seconds if you don't score another basket. To throw the ball simply touch (or click) on screen: the direction and force of the shot will depend on the position of your finger relative to the ball to throw. Let me know what you think. Edit: updated the post to show last version of the game.
  10. Gemollection Collect the gems into the chests of the same color by cutting chains and using punch boxes. Collect coins for extra points.Tap on chain to cut it and figure out how to get the gems into the treasure chests of the matching colors. And finally get rich! We used adapted box2d engine and our framework "Squire". The game supports most screen resolutions. Hope you'll like it yours truly, True Token
  11. Hey guys, i want to develop a physics game for mobile web like this game (http://www.addictinggames.com/shooting-games/zombie-shooter-game.jsp) ,i want to know if this type of games play well on mobile browsers. regards,
  12. I am trying to create a simple air hockey implementation in Phaser and can't figure out how to change the shapes of physics bodies to be circular. It appears in the arcade physics system that ALL bodies are rectangular, but in the source there's an "advanced" physics folder there that appears to allow you to create bodies of varying shapes. Is there an example of how to use these shapes anywhere in the examples or WIP? From reading previous posts on this forum, it looks like there's actually two physics engines currently in the code (arcade and the N+ library?). Perhaps is there a way to swap-out which engine is used so I can have circular bodies? Thanks!!!
  13. Box2D physics engine works according to the rules of physics. You have to work a little bit to set it up to work with platforms like HTML5 Canvas, iOS or Flash. Read the details Box2d coordinate system for HTML5 Canvas
  14. I got tired of adding basic physics over and over and decided to put together the best algorithms I could find into a couple tiny JS demo pages that I can later copy/paste from into any project. Feel free to submit improvements--it's a bit messy but well-commented and I cite my sources for further research for others. Fork it on github.
  15. This is the main question, I posted it on Stack Overflow so here's the link: http://stackoverflow.com/questions/17132342/html5-canvas-collision-with-ball-physics-glitch
  16. Hey folks this was Xploit Games Ludum Dare 26 Jam entry for "Minimalism". The game is called "Enlightenment": "Enlightenment is a 2D game where you throw things out of windows. It was written in HTML5 and WebGL using the Turbulenz engine and should work on any HTML5/WebGL browser. For the best experience we recommend Chrome. All code for the game and the hosting site (other than libraries) were written for the Ludum Dare jam. As a monk, you aspire to the minimalist aesthetic. A house free of clutter is your only desire. You walk the path to enlightenment, free of worldly possessions. But your housemates, they thwart you. They love to buy stuff online. Defenestrate these worldly shackles and attain enlightenment! Controls: A,D - move left and right S,W - aim E - traverse stairs SHIFT - flip held item SPACE - throw Xploit Games is a merry band of three coders and one artist. Some of us work at Turbulenz, some of us don't" Goto: xploitgames.com/ludum-dare-26 If you like it please vote on the ludum dare page: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=22892 You can tweet your score from in game so we'd love to know how fast people can play it. You can follow us on twitter: @xploitgames We had a few DNS issues which should be fixed now. Contact us if you're having issues!
  17. Just, wow http://codepen.io/stuffit/details/KrAwx
  18. Physijs brings a very easy to use interface to the three.js framework. One of the reasons three.js is so popular is because it is so incredibly easy for graphics newbies to get into 3D programming. Physijs takes that philosophy to heart and makes physics simulations just as easy to run. In fact, there are just five easy steps that must be taken to make a 3D scene come alive. http://chandlerprall.github.com/Physijs/