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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 670 results

  1. I’m trying to make a game with a rocket ship navigating in a cave. The cave is broken up into 400x400 big tiles that’s combined to form a bigger cave. They all have physics-maps from “PhysicsEditor” that seems to work correctly. My tileclass: export default class Tile extends Phaser.Physics.Matter.Sprite { constructor(scene, x, y, sprite, phymap) { super(scene.matter.world, x, y, sprite, 0, { shape: phymap }); this.setStatic(true); this.setBounce(0.05); scene.add.existing(this); } } And these are added in game.js: tilemap[1][0] = new Tile(this, 0, 0, 'ground', tile_body.ground) tilemap[0][0] = new Tile(this, -400, 0, 'bottom-left', tile_body.bottom_left) tilemap[0][1] = new Tile(this, -400, -400, 'vertical', tile_body.vertical) But the tiles are all over the place, if I set them all on position (0, 0) you can see it more clearly: Any ideas to what I am doing wrong? I thought all would be on top of each other if created at position (0, 0) with the same height and width?
  2. Hello, I'm a web programmer with 3 years of experience (currently a senior developer). I've always been a fan of videogames and now I'm starting learning game development just for fun. Like in any type of development , you always face problems and learn of those. Sharing is the strongest tool to learn, you help other people to prevent/fix mistakes and they help you. What am I looking for?: People like me that is learning to develop games and want to meet other people to make games with them, share experiences, ask&answer questions. How will we organize? I have experience managing large Telegram groups and also creating bots for groups. It is a good starting point since most of the people always carry the phone everywhere and also has a web/desktop application, also Telegram offers us a direct communication without compromising your privacy (you don't need to give real info or phone number to the rest of the group). If we start growing, we can just move to another platform you want (Discord, Slack, whatever is of your preference). Do you have any project scheduled? Yes, I want to build a fun roguelike, here is my current roadmap of the game: I am an artist, can I join? Sure! I'm sure you can learn from us and we can learn from you, Keep in mind that sound artists, level designers, programmers.. work together and they need to understand all the other positions to work properly. Of course this is a flexible diagram, I don't do this as my job and I don't have any deadlines, creating a roadmap just helps me with organization so I don't start wrongly (which with end even worse :P). Have in mind that my only goal is just learning, I'm not in a rush to make money or finding a job Just feel free to contact me if you want to join or if you doesn't like something of my post.
  3. I wanted to share a Phaser 3 game I’ve been working on. The entire game is made on my iPhone with Textastic and a vector drawing app, so there are no keyboard inputs. The controls are fairly simple. Just slide your finger left or right to move, and you can either swipe the same finger to jump, or swipe with your other hand while running. To climb the rope, you just have to slide up or down; and to swing, slide left or right. To enable the slingshot, click on the character, pull the rock back, and let it go. When you start to fall in the hot air balloon, hold your finger on the screen and it becomes an “endless runner” until 3 birds fly by. This game is not anywhere near completion, and I imagine it will take several years to finish it on my own. The animation is not great, but I have downloaded DragonBones and will be trying it soon. I hope you like it, and please let me know what you think. Thanks! https://cannabijoy.com/matter.html FullSizeRender.mov
  4. Hello. I'm indie game developer and currently working on Offroad Mania — game for everyone, who like off road and challenge. Offroad Mania on Steam https://store.steampowered.com/app/1222040/Offroad_Mania/ Write me in Discord and I give free game keys https://discord.gg/S7qpVaB Free web demo https://html5.gamedistribution.com/268e3f7dc6e6481298fafa5f3cf9e911/ Features: — 120 levels with rocks, trees, bridges, springboards etc. — 5 amazing 4×4 off road cars for fun — Car physics based game — Car and driver customizing — Fun driving gameplay — Colorful and clean game graphics — Gamepad support — Fullscreen mode p.s. In the future, I plan to do free updates (new cars, new tracks, etc.). Therefore it is very important your feedback and suggestions. Thanks for comments! Contacts: Email: activegamesbox@gmail.com Discord: https://discord.gg/S7qpVaB Twitter: @activegames
  5. // hello again lads! I've got another problem. I was working on a game and I was specifically // working on a Gameplay scene and there was no specific error in the console but the physics // collider between my platform and the player wasn't working and my player fell through the // platform. Can somebody point out the mistake I've made? Any help will be greatly appreciated :) // The code from my 'Gameplay' scene: var platform; var player; class gamePlay extends Phaser.Scene{ constructor(){ super({key: 'playing'}); } preload(){ this.load.image('sky', 'assets/sky.png'); this.load.image('sun', 'assets/sun.png'); this.load.image('ground', 'assets/platform.png'); this.load.image('cubey', 'assets/cubey(1).png', {frameWidth: 32, frameHeight: 32} ); } create(){ this.add.image(400, 300, 'sky'); this.add.image(400, 100, 'sun'); platform = this.physics.add.staticGroup(); platform.create(400, 500, 'ground'); platform.create(250, 500, 'ground'); platform.create(500, 500, 'ground'); player = this.physics.add.sprite(400, 300, 'cubey'); player.setBounce(0.3); player.setCollideWorldBounds(true); this.physics.add.collider(player, platform); // not working } update(){ } }
  6. Super-excited to announce some new experimental PlayCanvas technology that simulates cloth physics. final_5ed7a246132aee0015b5c0af_798743.mp4 Check out the blog article describing how it was done: https://blog.playcanvas.com/implementing-cloth-simulation-in-webgl/ Just a first step - but the added realism for character rendering is superb. Let us know what you think!
  7. I have this map created in Tiled, with an object layer for the doors. And this door object has a custom property "link", which should tell where the door goes. In phaser, I created an object layer for this doors and put them in to a new static group (this.physics.add.staticGroup). And if the player hits this door object, a method get called: this.physics.add.overlap( this.player, doors, this.enterDoor , null, this ). And there, in the enterDoor method, I want to read the "link" property, so I can switch the scene based on that value, which tells where to go next. But I am not able to get it there, it not seems to be possible to even add this value to the childs of the group, because already there, these values get lost. I am looking for a solution to this problem. These are the parts of the relevant code: Part 1, colliding with the door works without problems. Only thing there is, I have a missing sprite picture in game, but I do not want to use any sprite for the door. It should be a invisible area and if the player hits, it should go to the next scene. create() { this.map = this.add.tilemap( 'map1' ); var tileset = this.map.addTilesetImage( 'main', 'tiles' ); this.firstLayer = this.map.createStaticLayer( 'layer1', tileset ); this.secondLayer = this.map.createStaticLayer( 'layer2', tileset ); this.thirdLayer = this.map.createStaticLayer( 'layer3', tileset ); this.createPlayer( 400, 400 ); this.secondLayer.setCollisionBetween( 1, 2000 ); this.physics.add.collider( this.player, this.secondLayer); this.objectLayer = this.map.getObjectLayer( 'objectLayer' ); var doors; this.objectLayer.objects.forEach( ( object, index ) => { if (object.type === 'door') { object.key = object.name; object.setXY = { x: object.x + 16, y: object.y + 16 }; doors = this.physics.add.staticGroup( object ); //doors[ index ].set( 'link', object.link ); } }); this.physics.add.overlap( this.player, doors, this.enterDoor , null, this ); } Part 2, this is the enterDoor Method, called if the player hits the door. There I want to read the door.link property and based on that, go to the next scene. enterDoor( player, door ) { console.log( door.link ); //undefined door.disableBody( true, true) ; this.scene.switch( 'Outside', Outside ); // it should be like this: // this.scene.switch( door.link, door.link ); }
  8. Sup my dudes, My latest game Bouncy Woods was released just yesterday on Poki - https://poki.com/en/g/bouncy-woods It was developed with Phaser 3 and MatterJS. Matter was pain in ass to deal with because I really needed "bullet" like bodies for this game and Matter doesn't support it. So sometimes you can notice "tunneling" issue - when balls go through blocks. If you have any feedback or questions regarding the game - please let me know. Gameplay video
  9. Hi, I saw the code presented in the link https://playground.babylonjs.com/#1NQTNE#11 and played many times. I felt "moveWithCollisions" is full of magic . it seems that with the help of "movewithCollisions" the mesh can smartly move and move little by little and finally manage to find its path to reach its destination. I checked the code but was not able to figure out how to use it exactly, there is few comment or remarks to tell what's the purpose of some important lines . so I listed these important lines that I didn't understand as below. can anyone please help to explain what's the purpose of these critical lines? (please notice that I use "//" to bring up what my question is ) // move to clicked coordinates ............ if(meshPlayer.destination) { var moveVector = meshPlayer.destination.subtract(meshPlayer.position); if (moveVector.length() > 1.1) { //1.why use 1.1 ,other than 2.2 or 0.8 or any length else? is it related to the player size 1 while downcasting a ray ? moveVector.y = GRAVITY; //2.GRAVITY is -0.5 as defined earlier, but why moveVector.y must be -0.5? what's the purpose to assign moveVector.y ? moveVector = moveVector.normalize();//3.what's the purpose of "normalize"?what's the benefit of doing this? is this line mandatory? moveVector = moveVector.scale(0.2); //4.why to shrink the moveVector to 1/5 of its original size? why not 0.1 or 2 or some number else? if(meshFound.distance > 1.1){moveVector.y = GRAVITY;} //5.why 1.1 again? meshPlayer.moveWithCollisions(moveVector); } else { meshPlayer.destination = null; } } .......... It's really appreciated for your time. Edit Your content will need to be approved by a moderator
  10. Hi, How can i play right with the acceleration of the velocity? In this tutorial http://www.photonstorm.com/phaser/tutorial-making-your-first-phaser-game (really well done), but it only change the velocity. How can i accelerate it the way a race game works? I want to accelerate it from 0 to a maximum number, or it's current value to a maximum number. How can i do this? What's the best way to handle it and create a maximum speed? Thank you very much guys
  11. What physics engines are available for Javascript and/or Typescript? I've searched myself but maybe there's one or two I missed. I also found a post in these forums but that's over two years old now; It's a little disappointing to see that some of them aren't actively developed and lacking a lot of features. I put together a test to compare the different engines I tried - I've attached the files if anyone wants to try it out. Here are the engines I've tried: PhysicsJs http://wellcaffeinated.net/PhysicsJS/ - Incomplete: lacking simple features like constraints - Seems like it was last updated 2 years ago - Possibly the worst performance - Strange API (in my opinion) and difficult to use - Built in mouse interaction behaves strangely MatterJs http://brm.io/matter-js/ - Also incomplete and lacking constraints - Has a built in mouse constraint but it acts strangely - Updated recently - Simple and easy to use - Doesn't handle stress test well p2.js http://schteppe.github.io/p2.js/ - Complete - Updated within the last few months - Doesn't handle stress test well - Easy to use - Good documentation Box2DWeb https://github.com/hecht-software/box2dweb - Complete - everything you would expect from Box2D - Last updated one or two years ago - Semi-poor documentation - you have use the box2d flash documentation which is fairly thorough but slightly outdated - Much faster and a lot more accurate than the above three libraries. Nape http://napephys.com/ - Complete - lots of features - but isn't very active - Has a great marching squares utility which can convert bitmaps into polygons - Good site and documentation - Easy to use but the pooling get/dispose stuff can be a bit confusing - Similar (or maybe even slight better) performance to Box2DWeb and possibly more accurate - Large - minified it's still 1.7MB The one problem with Nape though is that it isn't really meant for Javascript and I had a lot of trouble getting it set up in Typescript. There were some project to convert it to js and generate definition files but I had to modify them a lot to get something complete that worked for me. I also had to manually convert the debug draw classes from as3 to js and Easeljs. Luckily that only needs to be done once - after that I didn't have any problems using it though. I also tried PhysicsType2D (http://physicstype2d.com/) but couldn't get it to work. Overall I was a bit disappointed; In terms of performance, the 'native' js libraries fell short by a lot compared to the two ported ones, and on top of that they lacked a lot of important features. Even the ported ones didn't perform as well as their Flash/As3 versions - the Nape stress test (you can find it here) which I copied, runs significantly better in flash. PhysicsLib.zip UPDATE: You can find the updated github repo here: https://github.com/cmann1/Javascript-Physics-Library-Tests/
  12. I'm just starting with libraries for JS 2D game development and I want to pair these two and I've spent several hours trying everything I can and all the examples I could find on how to use Pixi.js sprites and shapes but I feel like I can't get it right. If I get anything to work at all, it is always either really clunky code that I think will affect some functionality or performance later. Here's an example on how to use a JS canvas with Matter.js, and I even tried using PIXI.Graphics to replicate this: https://github.com/liabru/matter-js/wiki/Rendering I really want to be able to draw shapes like rectangles and circles and have them work as PIXI.Sprite, while also as a Matter.Body. I want shapes first so that I don't have to look for and load images when I simply want to try out an idea. I found an example here that I tried replicating, but making general functions that create an object that contains the sprite and the body objects. https://codepen.io/BakerCo/pen/ojKJJb?editors=0010 Instead of loading an image, I created a PIXI.Graphics shape, generated a canvas from it with Pixi and created a PIXI.Sprite. Loading an image and making a Sprite is so much more simple, but for later. I'm just starting with libraries for JS 2D game development and I want to pair these two and I've spent several hours trying everything I can and all the examples I could find on how to use Pixi.js sprites and shapes but I feel like I can't get it right. If I get anything to work at all, it is always either really clunky code that I think will affect some functionality or performance later. Here's an example on how to use a JS canvas with Matter.js, and I even tried using PIXI.Graphics to replicate this: https://github.com/liabru/matter-js/wiki/Rendering I really want to be able to draw shapes like rectangles and circles and have them work as PIXI.Sprite, while also as a Matter.Body. I want shapes first so that I don't have to look for and load images when I simply want to try out an idea. I found an example here that I tried replicating, but making general functions that create an object that contains the sprite and the body objects. https://codepen.io/BakerCo/pen/ojKJJb?editors=0010 Instead of loading an image, I created a PIXI.Graphics shape, generated a canvas from it with Pixi and created a PIXI.Sprite. Loading an image and making a Sprite is so much more simple, but for later. The whole result was a jaggy, low quality version of the Matter.js Getting Started example. There has to be a good way to pair any renderer with Matter.js, right? Please can you show me how to do this properly? The whole result was a jaggy, low quality version of the Matter.js Getting Started example. There has to be a good way to pair any renderer with Matter.js, right? Please can you show me how to do this properly? P.S. I know there is a Matter.RenderPixi module, but it is deprecated and I want to learn how to actually combine a renderer with a physics engine for the freedom and understanding.
  13. Ninja.io is a fast paced, 2D multiplayer shooter inspired by games like Soldat, Unreal Tournament and N-game. Currently implemented game modes include Capture the Flag and Deathmatch. It uses the Box2D physics engine to enable convincing rigid body simulation. Players can make various moves including backflips, rolls, proning, running, flying and crouching. The game is still under active development and I'm willing to devote a great deal of time to finishing this project. I've made a test server available and you can join it by following these steps: - Go to ninja.io - Play as Guest - Enter a username - Join CTF or Deathmatch. - Select primary and/or secondary weapon Press H to display table of controls. Decrease the size of the browser window in case it runs slow. I've noticed that some laptops and older systems have trouble maintaining adequate fps. It is currently not possible to register a username, but I've been making progress on an account and highscore system. The game server is currently located in Europe. I plan on running additional servers on other continents and for the site to serve as a gateway to the nearest game server when players join in order to minimize latency. 2 European and 3 North American servers are available. Any thoughts, feedback or suggestions would be much appreciated! Thanks. Edit - 15-12-2017: New version! Sound effects have finally been added, weapons & items have been updated & tweaked, libraries have been updated and many improvements have been made along with numerous bugfixes. Edit - 15-05-2019: Several versions later: lots of new stuff! Running in Pixi.js v5 now. Party mode has been added, several new maps, new weapons, new sounds, new UI, new account/profile management (WIP), new FX! More to come! I'm currently finishing the implementation of the account system and I'm working on several new maps. More updates will follow soon!
  14. Hello, hope you'll are doing fine. I'm a beginner programmer and recently I've been working on a 2d physics game engine in JavaScript. Everything seemed to be working fine until I have come across an annoying bug in my push mechanic. I have created a 2d collision system where object A will be pushed away b object B, etc. In addition, I have created a push mechanic meaning, object A can push object b (if it’s not solid). However, I have come upon a problem where e.g. object A (Player), object B (box which the player can push) and object C (Solid wall), he problem occurs when object a pushes object b against object, what happens is object B gets pushed away by object A, but object A doesn’t get pushed away by B meaning, object A will get inside of object B and it will push the object to the top instead of pushing it to the left by activating the wrong collision detection. (as seen in the video). Video which shows the problem: https://www.youtube.com/watch?v=8DHKJNOrO54 (Project files below) I've been trying to solve this problem for awhile now and I just can't find the perfect solution. If anyone would be able to help it'd be great. Thank you game_v1.zip
  15. Hello there! I'm working with this example (asteroids movement): LINK There is a strange behaviour that blows my brain out. It can be better seen on the attached video. All I've done was a small rotation and then just pressed UP cursor key. As you can see with the help of turned on debugger velocity vector rotates during fly until it reaches bottom-right corner of the bounding box. Also it force ship to fly wrong, it can be noticed even without debugger. Expected that velocity vector to be applied directly to where ship's nose is (or more correctly, ship have to move to the opposite side the engines work vector; see the picture). What can be the solution of this problems? Seems velocityFromRotation() function works not as expected. Or there is something been lost. Best regards, Nick Rimer 2019-11-01 12-02-08.mp4
  16. https://apollinaria-felix.itch.io/climbing-on-the-trees An interesting mix of the endless runner with the jumper. Control your character with the keyboard, and try not to fall down, by using the cloud platforms, branches, or by clinging to a tree on the left. Be careful - some of branches are begin falling, after you step on them. The cloud platforms are moving, but they stay on the screen. Along the way, collect coins and also the milk, which is needed to restore health, since there are many enemies on these money trees. 😈 If you have lost full four hearts or fall below the screen, game will be end.
  17. So I am working on my just general knowledge of how phaser works, I have only done two tutorials. But I think I have a decent grasp on it so far. But I am running into a little problem, I am trying to use the Follower object, so that I don't have to create the vec2 and attach it, but I don't seem to understand the documentation or what it means by "If this Game Object is enabled for physics then this property will contain a reference to a Physics Body." I have scoured the docs for hours. I see how to 'enable' in arcade physics but I cannot find any reference to how with impact physics. I am able to create a body object, and assign it to the game object, as well as assign the the game object to the body, but they do not move in tandem. in fact the body does not move at all. P.S. This is not the only bug, when converting from matter.js to impact.js physics my logic on pausing player movement when the dialog modal broke. but one problem at a time.. P.P.S I know its not the best code //SHIVA path3 = new Phaser.Curves.Path(550, 450); path3.lineTo(450, 450); path3.lineTo(450, 505); path3.lineTo(550, 505); path3.lineTo(550, 450); path3.lineTo(450, 450); shiva = this.add.follower(path3, 550, 450, 'shiva'); //Phaser.GameObjects.BuildGameObject(this, Phaser.GameObjects.PathFollower) //this.game.physics.enable(shiva, impact); shivaBody = this.impact.add.body(550, 450, 16, 12); //TRYING DIFFERENT WAS TO SET BODY //shivaBody.setOffset(550, 450, 16, 12); shiva.body = shivaBody; shivaBody.setGameObject(shiva); shiva.name = "shiva"; shiva.setRotation(); shiva.depth = 30; //ALT WAY TO GET NAME //shiva.name = "shiva"; shiva.setData(npc, true); shiva.setData("name", "shiva"); npcBodies[2] = shivaBody; npcs.add(shiva); shiva.startFollow({ ease: 'Linear', duration:6000, yoyo:true, repeat: -1, _delay: 200, delay: 100 }); P.P.P.S I also tried this.physics.world.enable(shiva); this.impact.world.enable(shiva); dialog_plugin.js game.js index.html city.json
  18. Hey everyone, I looked around for details on this but I am trying to determine the difference between the Physic types: Arcade, Impact, Matter to see what would be best for my type of game or to experiment with. I read in the Dev blogs that "Arcade" was meant for very simple physics in a game, while somewhere else I read that "Matter" was meant for debugging... I would like to know what the real differences are and which would make the most sense for a given game type. Does anyone know what the differences between the Physic types are? Thanks!!!
  19. hello a need help with p2 if anybody of you, provide me some information about using force I'd appreciate, I'm following the example I'm trying to use this code postStep but what I don't understand where to put that code if is inside animation loop or outside the game loop, I tried different ways but it didn't work for me. I'm using phaser's game loop (update) for my main loop. world.on('postStep', function(event){ // Add horizontal spring force circleBody.force[0] -= 100 * circleBody.position[0]; });
  20. Hi, Tower Boom is my first HTML5 game. It has 24 levels, and now available for non-exclusive licensing. The game was ported from flash, you can play the flash at https://www.coolmathgames.com/0-tower-boom If you're interested, feel free to send me a PM, I'll give you the HTML5 link. Here are some screenshoots...
  21. hi, because some issue, so i using group to create sprite as my colliders. var octopus; var colliders; var col; function create() { octopus = game.add.sprite(300, 200, 'octopus'); colliders = game.make.group(octopus, 'colliders', null, true, Phaser.Physics.ARCADE); octopus.updateTransform(); col = colliders.create(0, 0); col.body.setCircle(30, -30, -30); col.body.reset(colliders.worldPosition.x + col.x, colliders.worldPosition.y + col.y); game.debug.body(col, 'rgba(255,0,0,0.5)'); } function update(){ game.debug.body(col, 'rgba(255,0,0,0.5)'); } in the example, the body will flash to another point and then go back to the correct position. if i try to use Arcade Physics's overlap in two group. although two group is not overlap. that still cause overlap event. sorry about my english is not well
  22. Hello guys ! I'm trying to make an anatomy based app with bones, muscles and ligaments. I'm actually prototyping to see if that's possible but I'm stuck on some features. Muscle representation For the muscles, I was thinking about a spring joint. But when I was testing, it seems that we can't add multiple joints between the same impostors ? For exemple, if we have 4 muscles between two cubes, each going corner to corner. If one spring is stiffer, the cube should rotate but it's not. I actually tried the same thing about a year ago on Unity and it was working like a charm but the unity webgl build is just too heavy and restrictive. Am I doing something wrong ? Do I need a new impostor for each muscle insertion ? Complex joint For some body joints, the simpler will be to add some angles restrictions. For exemple the ankle has like 30° flexion and 50° extension + 40° pronation and 20° supination. Is there a way to add this limitations ? My research on google point me only to https://saharan.github.io/OimoPhysics/oimo/dynamics/constraint/joint/RagdollJoint.html. Oimos can only limit in one axis and cannon seems to not have this feature. My playground : https://www.babylonjs-playground.com/#TB6ER9#1 Here what've done on Unity: https://imgshare.io/image/body-joint.pmmO9 (the img uploader was not working). Thanks. I didn't saw the new forum, my bad. The red banner isn't red enought :p. Here is the link to the new post => https://forum.babylonjs.com/t/how-to-handle-multiple-joints-between-two-impostors/3258
  23. I'm starting out learning to build games in Phaser and doing multiplayer games and had the idea that I would build a simple multiplayer game to play with the kids. the basic idea: Two teams of either 1 or 2 players each kick a ball around a bounded area trying to get it into the opposing teams goal. I've played around with the physics engine demos a little bit and think I know enough to make a player (circle) that can move a ball (another circle) around in a Phaser game using P2 physics. I've also messed a little bit with node.js and the sockes library and implemented a little demo of setting up a server for multiplayer. Now I have gotten to the question of how to handle the physics in a multiplayer game. It seems to me like the physics simulation should be running on the server but how do you do that? Do I run a Phaser instance on the server to simulate physics or do I choose a standalone physics library and run that on the server? Bonus question: If physics is being simulated on the server do I need to run any physics on the client in this multiplayer example?
  24. Language: TypeScript Physics Engine: CannonJS Hey all, I would appreciate it if someone would help me solve these 2 mesh physics problems that I feel are related. I spent a lot of time trying to solve these related issues on my own and could not figure out what was going wrong. RELEVANT NOTE: BOTH problems occur right after switching from 1 scene to another scene. They only happen right after a scene loads. I have a video that demonstrates the error below. Problem 1: After loading each mesh (each with its own physics impostor), each mesh jumps a little (and then afterwards, they start falling because of gravity). I was wondering why/how to prevent it from happening. Note: I suspected that it is because they load too close to the ground and bounce because the computer erroneously thinks that the meshes/ground are touching. I am able to lessen the jump by making the ground’s position.y = -0.5 (so it is even clearer to the computer that the objects are not touching because all objects right now load at position.y = 0 (and I move objects before the next object loads so they don't intersect and start a collision)), but the jump still occurs, just less of a jump and still noticeable. Problem 2: After loading a certain scene, after being loaded, each instance of a special object I created (a class I created that includes a mesh) jumps in opposite directions from each other. I’m not sure why. I have a feeling it has to do with having multiple instances of the same class, each with their own mesh. After the scene loads, I am able to individually access each mesh and have them move individually, so their movement isn’t intertwined. Code/Video in Link: Relevant code and 1 video demonstrating error are in the Dropbox link. Note: The video shows both errors happening at the same time. Note: The code in this folder are not in the same directory/folder structure that I normally use for this program (so that is not the cause of my issues) [Link Removed] Thank you to all who read/and might help me with this issue!
  25. Hello I'm a beginner with Phaser and I want to extended a physcis sprite. So this is my code. class Player extends Phaser.Physics.Arcade.Sprite { constructor (scene, x, y,texture) { super(scene, x, y,texture); } } var player1; var MyScene = new Phaser.Class({ Extends: Phaser.Scene, initialize: function MyScene (config) { Phaser.Scene.call(this, config) }, preload: function () { this.load.image('back', 'img/background.jpg'); this.load.image('dude', 'img/player.png'); }, create: function () { this.add.image(540,360, 'back'); player1 = new Player(this, 400, 100, 'dude'); this.add.existing(player1); } }); var config = { type: Phaser.AUTO, width: 1080, height: 720, physics: { default: 'arcade', arcade: { gravity: { y: 1000 }, debug: false } }, scene: MyScene }; var game = new Phaser.Game(config); The object display the sprite but the object don't fall and I can not set something in my class. I search a long time a long time on internet and I didn't found. Do someone know where is my mistake ?