Jump to content

Search the Community

Showing results for tags 'gravity'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • 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


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





  1. Hi I have applied a freecamera to my project. camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(-40, cameraHeight,-132), scene); I have applied gravity to it so that it won't fly ie: camera.applyGravity = true; I have given it a constant height (cameraHeight) scene.registerBeforeRender(function () { scene.activeCamera.position.y = cameraHeight; }); Now the problem is that when I move the mouse up and down along the Y axis the camera rotates (in essence on the x-axis). So the camera is elevated and it's like flying.I have checked the ESPILIT demo and it's
  2. So I have a scene that I got from another person that I've exported from Blender into Babylon, but whenever I try to render the scene dynamically it falls straight down. Changing the physics of the scene in Babylon doesn't seem to work, nor does creating a ground object with collisions enabled. I've attached the scene in question; what am I missing? example.babylon
  3. Dokia Dokia is a challenging platformer in which you have to change the direction of gravity in order to proceed. This game contains 4 worlds with 10 levels each! Try to reach the hole in all of them. It may be hard, but it is worth it! It may take a while to get used to the way the gravity-switching works, but that is part of the game. You can play the game here: https://www.kongregate.com/games/Diamonax/dokia I hope you like it!
  4. On colliding with a box the camera sees through the box. In the following PGs I have used camera.ellipsoidOffset to place the camera at the middle of the ellipsoid (line 86) and used two viewposts. The lower viewport uses a second camera slightly above and behind the main camera. I have added a cone to represent the main camera with an ellipsoid around it. I have also customized the key input behaviour. Up and down arrow keys move the camera forward and backward , left and right arrow keys turn the camera. I have also lowered the speed of the camera. Face a box and walk towards it un
  5. Hi, Can I somehow (with physics plugin Oimo.js) set different gravity for different meshes? For example I want to simulate environment in water and I want to have there buoyancy. https://www.babylonjs-playground.com/#2B84TV#7 Thanks a lot for your advice.
  6. Hello evryone, i try to better understand collisions & mehs interactions. I found this demo on the babylon.js 101 docs: http://www.babylon.actifgames.com/moveCharacter/ https://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity Is it possible to get the source code ?
  7. Hello! In Phaser ( particularly Phaser CE ) I can't find something like Wind Resistance for objects. And start thinking how to implement my own version: create(){ game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.gravity.y = 100; this.car = game.add.sprite(32, 32, "car"); game.physics.p2.enable(this.car,false); this.car.body.windResistance = 0.4; } update(){ if(this.car.body.windResistance && this.car.body.velocity.y > this.car.body.windResistance ){ this.car.body.velocity.y-= this.car.body.windResistance; } }
  8. Schubi Action and skill game in spirit of Thrust and Space Taxi. Direct link: http://www.beppigames.de/play/schubi/index.html Games page: http://www.beppigames.de/schubi/index.html Homepage (find my other games there, for each there is a html5 version): http://www.beppigames.de PREFACE If puzzled by the first level please read "WHAT TO DO IN LEVEL 1" below. May take 30 seconds to 10 minutes to pickup and develop necessary skills. Difficulty level is nasty but easier than in the aforementioned classics. To solve all levels probably takes a
  9. Hello, I'm currently building a scene where a person walks through a room. There are several objects in the room. When I run and run against a large mesh, I collide and can't get through (it's wanted). When I walk towards a low (low height) mesh, I'm suddenly reset, probably to the old position. Camera position: [0.1.2, -2.25] Camera ellipsoid: [0.5,0.59,0.5] Scene gravity: [0, -9.81, 0] Bottom is at y = 0 How do I set the camera's collisionsbox correctly to run on the floor and not get the effect of low meshes? Thank you.
  10. I see the docs of the Body class http://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.Body.html But i am not sure which would be the right property to change. I have two balloons falling down and they might both at the same time or one after the other, hit my rectangle. The problem is, both objects stop moving after they hit the rectangle. i am sure this has to do something with physics. As if the vertical(y coordinate) velocity gets set to 0 when they hit the rectangle. Here is a sample code: graphics = si.gameObject.add.sprite(boxX, boxY, si.ImageAssetKeys.BALLOON_ANIM_ATLAS, 0);
  11. Hi there, my first post! I'm learning how to use Phaser by following a cool tutorial by Wild . At a moment he explains us how to move our player by using keyboard input. And everything works fine but the jump mouvement =/ And I don't understand why! (my browser console says nothing). Nothing happens when I press the up button. Here is my code if someone is willing to explain me a bit what's wrong? in the create player.animations.add('idle',[0,1],1,true); player.animations.add('jump',[2],1,true); player.animations.add('run',[3,4,5,6,7,8],7,true); this.physi
  12. Hi, I imported a mesh and then separated it into two objects. Basically a wheel and a stand for the wheel. And I want the axle for the wheel to fall onto the stand and allow me to spin the wheel. My problem is that I can't get the physics to work right. I either drop things through the floor or gravity doesn't work at all, depending on the different engines and things I've tried. I'm new to babylonjs so perhaps I'm doing wrong something that's simple to see. My code is at http://www.babylonjs-playground.com/#2I8LFS#2 If anyone can see what I'm doing wrong, I'd much a
  13. I thought this would be a simple fix, but so far can't figure it out at all. I have something I call trapledges that is going to fall in the y direction when colliding with player. However, I can not get them to stop moving in the x direction if the player touch the side of them. In my code I have a commented out if test in the update function. I've tried it out both there and in the else if test where the trapledges get made. also tried out different things in the test as changing velocity.x = 0; to for example gravity = 0; or trapLedge.immovable.x = true; and so on. Still won't stop floating
  14. Hi @all again, is there a way to change the gravity for certain space? Case 01: I want for example that the player or other objects can fly to space. So if specific distance has been reached from the ground, the gravity should decrease with rising distance, until null. Case 02: If the player or other objects goes into a hidden area/space/box, the gravity for all objects in there is different to the world gravity (scene.gravity). Thanks for ideas.
  15. Hi there, I'm creating a simple platform game where you can shoot enemies. I've applied game.physics.arcade.gravity.y = 1000; But this seems to now affect my weapon class and bullets too! How do I set my weapons or bullets to NOT be affected by gravity? Here's the code I've used for reference: var playState = { //code to make assets goes here create: function(){ /*-- creating player --*/ game.add.sprite(0, 0, 'background'); game.physics.arcade.gravity.y = 1000; //Do not enable, need to fix gravity. this.player = game.ad
  16. Antoine553

    New noob

    Hello Happy New Year everyone I'm a french student which has a homework to make with phaser. I have then started to work and learn to use it and finally tried to make little game thanks the help of the many tutorials and examples on the web but i'm quite bad and i'm finally stuck at this point. For now the problem is to create many little alien (it will be change later) at the right of the screen and make them go to the left in a repetitive way but i tried one thousand method and always failed as you can see my last attempt XD i
  17. crffty


    Hi. I'm trying to make my first game with Phaser and I'm trying to get some physics working - global gravity. I'm not sure whats going on but somethings not working: vaultage.game.prototype = { create : function() { this.background = this.game.add.tileSprite(0, 0, this.game.width, 360, 'background'); this.background.autoScroll(-100, 0); this.background = this.game.add.tileSprite(0, 290, this.game.width, 8, 'ground'); this.background.autoScroll(-180, 0); this.player = this.add.sprite(30, 230, 'player'); this.player.animations.add('run'); this.play
  18. Hello Everybody!! I present to you, the BEST multiplayer casual space shooter game on the Internet today! -->WHAT IS IT ABOUT?? 1. It is a 2 dimensions multiplayer space game that is gravity based. 2. Your spaceship has stats that you can improve by either collecting items in space or by destroying other player's ship. 3. Everything in the game has mass, and newtonian physics has influence over everything. Entities are attracted to each other according to roughly (mass1*mass2)/distance^2. 4. Your ship has two basic stats that determine its defense, its armor a
  19. Hello, When I am using free camera and attached controls, camera is falling only for about 1 second and than stops. I have to press control key to begin falling again. Can increase this duration or give camera instruction to fall (something like moveWithCollisions )? http://www.babylonjs-playground.com/#21AD8N Thanks!
  20. So I've been working on a game (First Person Shooter): http://filmsbykris.com/scripts/metal_bullets One of the problems I have now is with the gravity. In stead of having people look through the mess of the code for that project, I've simplified it here: http://tinyurl.com/pfgjthp That scene might take a minute to load. It creates 3,000 random spheres in the scene. You can make the camera jump by clicking the mouse. The problem is this. When the scene gets complicated, and the frame rate drops, gravity slows down. So, in this example scene with the 3,000 spheres I get 60fps in chrome on my
  21. I am building a basketball game. I cannot get the ball to stop sticking to the rim colliders. When I was running p2 physics, the ball would simply bounce off the rim colliders as expected, but now, everytime the ball touches the rim colliders, it slows down movement rapidly and doesn't bounce or fall as expected. I think I might be missing a property setting somewhere. I set the rim colliders (leftMarker + rightMarker) to be immovable in create() but I'm not sure what else I need. I don't understand why the colliders stick to each other! Any help is appreciated! Basketball.Game = func
  22. Hello I got a 3dModel of an elevator. I trigger a button for it's position with the following code: myMesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, myMesh,"position.y",-2.6, 1000)) //down .then(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, myMesh,"position.y",0.001, 1000)); //up Witch works great! Accept when my char wants to get up again, he is falling through the ground, - the mesh. Few workarounds that come into my head, like check the state of the "event" an apply new gravity or new cam po
  23. I'm working on a game with a tilemap and arcade physics. The gravity is set to 1000 for the player and enemies movements and interacting which all work fine. However, when I add a particle emitter the particles also fall down? I've tried setting emitter.gravity to "0" but that doesn't help. The only thing that stops the particles from falling is disabling the line that sets game.physics.arcade.gravity.y, which is not what I want because the gravity is needed for the game. So my question is: how to disable the gravity of emitter particles? I've created a fiddle with example code
  24. Hi all, very new to Phaser and I'm trying to basically make a colour switch kind of game. So I am using p2 physics for the rotating arcs so I can add collision detection later. I had these arcs as graphics in the game but then couldn't add physics to them so they are now sprites in a group call wheel. I have the pivot point of the group set to (85,85). I don't know why but this number works, the sprites are 170x170 but when I try to give the group a pivot point such as (0.5,0.5) it doesn't work I've even tried (0.25,0.25) to try and recreate the (85,85) pivot point. I am trying to do this beca
  25. i would like to show you guys my first browser game, Planet boom, it's in an incomplete state since i was working on it for a workshop, but of course you can check out the code (which is kinda crappy) and if you like the concept you can probably contribute to the project, i'm always willing to join teams or collaborate on projects.
  • Create New...