wo997

Members
  • Content count

    76
  • Joined

  • Last visited

Everything posted by wo997

  1. Hi, I have made a game in resolution 1000:600px, but I realized that it's to big, and I want to scale it by ~0.7, and here is a problem because when I do this: game.camera.setSize(1000*0.7,600*0.7); game.stage.width*=0.7; game.stage.height*=0.7; game.width*=0.7; game.height*=0.7; game.camera.setSize(center.x*2*0.7,center.y*2*0.7); game.scale.refresh(); the game is scaled, but mouse pointer doesn't seem to be in the right position. How can I fix it?
  2. Can't make tilemap collision to work

    @Klmos try downloading example from here https://phaser.io/examples and then try to replace parts of code.
  3. [SOLVED]Physics not working.

    @Borislav I can't solve it, I left babylon.js just because of those glitches, at least I didn't like cannon.js, try using oimo.js and it should work.
  4. [SOLVED]Physics not working.

    Make a playground with it to let people solve it faster
  5. Loon Physics - Phaser P2 Physics Body Editor

    Cool! I wish I saw that a week ago, I finally created a tool like that where you can put points manually (it's rubish). Do you think you can make it more accurate? Actually it puts too many points when it's not needed, I would be pleased if I could make an algorithm for you which could minimize the amount of points, can I join your "team"?
  6. Howdy! I was so tired of searching free 2D physics body editor to Phaser.io, so I decided to create one myself. It works and it is quite accurate. Making physics bodies doesn't take that much time. The project is in early update, I was wondering if you would like to see more. I give you it in a file to download and here is my question - where should I host/share the project so everyone can see it after 1 click and can it be free (I am a poor kid)? I am always willing to answer wo997 physics.zip
  7. Time.deltaTime in Phaser?

    @spinnerbox thanks to @lewster32: var deltaTime=0; update -> deltaTime = game.time.elapsed/1000; Tell me if it works
  8. Load polygon - Phaser

    I am trying to load physics body in Phaser, but it doesn't work, here is a little part of the code: preload: game.load.physics('physicsData','assets/img/assets-pack.json'); create: grass.body.clearShapes(); grass.body.loadPolygon('physicsData','grassBody'); JSON file seems to be ok - I checked out the content. I get two alerts: *data is null* & *Phaser.Cache.getPhysicsData: Invalid key/object: "physicsData / grassBody"* - how can it be invalid?\ I can send the whole project if needed.
  9. @oobarbazanoo I can't say, but I think you can find examples like that in Phaser Editor, I downloaded it today
  10. Creating non-connected circles with graphics.arc()

    Can you specify what do you want to do? Do you want to move them separatelly?
  11. Detecting if mesh is not colliding with anything

    I think it's impossible to do it without repeating intersectsMesh(mesh,precise), but I hope there is a solution.
  12. Creating 2D physics body

    Can you suggest any 2D physics body editor so I can use it in Phaser game? It must be free to use.
  13. Rotate sphere inside cylinder

    @Hersir Consider making many jointed cuboids, can you image this arrangement? It's the only way to do it propertly, you need physics and rendering as well. Making them as one body can be a little challenge for you, I would use joints and I would place virtual cube in middle so it holds cuboids together.
  14. Rotate sphere inside cylinder

    @Hersir use @ to let me know about reply next time. first of all are you sure you need to apply force or can a body push each other? if not consider using applyImpulse https://doc.babylonjs.com/overviews/using_the_physics_engine#impulses-and-forces if you need to calculate the direction propertly ask me and I will show you how to do it using rotation matrix. Sorry if I didn't understand what you meant.
  15. Rotate sphere inside cylinder

    or just use cannon.js it's simple to use, just ask me for more info
  16. Rotate sphere inside cylinder

    As long as the movement is not very hard to code you can do it by simply setting position, it's your choice
  17. Try using img.naturalWidth, img.naturalHeight, is it enough? Is there a problem with making canvas of that size now?
  18. Finally I can help someone Keep your jointAB in a variable so you can use it later: scene.getPhysicsEngine().removeJoint(meshA.physicsImpostor,meshB.physicsImpostor,jointAB); If you want to see my project with helicopter able to crash when forces between body elements are to high just ask me.
  19. Want to promote your game?

    What the heck, I clicked email and it crashed my browser, is it a virus?
  20. @BeanstalkBlue I was thinking about changing the height of each particle so it doesn't render side walls (these which are on the same height, they are flat), is it a good idea? This may cause more problems though. If that doesn't work you will probably have to subtract height for rendering for tiny values, make it like: renderHeight = baseHeight - distanceToCamera/1000, where 1000 is just a big value, not to affect visual effects to much.
  21. First of all here is my project, controls are WASD and mouse. http://babylonjs-playground.azurewebsites.net/#11OMIX#26 I was wondering what is causing some kind of friction between the ground and a tank, try to press A or D for 5 seconds, it will not turn smoothly, I noticed that the glitch occurs when the tank is on X or Z axis (probably also on Y axis too but I didn't try). You can see that wheels are rotating propertly, there are no forces pushing the hull, just wheels are jointed to it. Any ideas?
  22. Movement glitch babylon/cannon.js

    @RaananW I forgot to say you have to press Q/E to rotate the mesh (try different angles, f.e. 35 degrees from start position), then the direction of friction force is wrong, it shouldn't go sideways, but forward. The bug is there, I am 100% sure.
  23. Movement glitch babylon/cannon.js

    @fenomas @RaananW I got the simplest possible scene http://babylonjs-playground.azurewebsites.net/#24QL2E#1 I have only added a script that changes direction and pushes the body along its rotation matrix, nothing special but the glitch is visible. I think that friction is just wrongly programmed in cannon.js but I hope there is a solution.
  24. Movement glitch babylon/cannon.js

    @fenomas It will take me a lot of time to do, but if you want it then I will try I may have a little trouble with switching it back though.