Woff Posted September 28, 2014 Share Posted September 28, 2014 Hello gentlemen, last week between work and household chores I was working on my game. With your help and with google I've solved many tasks, but now it's already Sunday, but I've got some unresolved tasks, here they are: 1. My actual game world size is 1920 * 800, but if I try to make it (for example 3000 * 1200), he is still 1920.. Here is something about my game's width and height:var game = new Phaser.Game(1200, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });game.world.setBounds(0, 0, 1920, 1200); I'd like my game world woud be wider2. When I add some sprite, and sett it's size, everything looks good, but if sprite is not rectangular, how can I remove the empty spaces and set form to it (screenshot bellow) ?A short description of the picture: the user is on the bus, but it looks as if he is floating in the airHope I described all clear Link to comment Share on other sites More sharing options...
george Posted September 28, 2014 Share Posted September 28, 2014 Regarding #2I bet you're using phaser's arcade physics engine and not P2. This engine only supports AABB collisions, which hare collisions between full rectangles. There is no support for polygons, which your car needs so your character is not floating above. Look at the following P2 example, which nicely shows images with polygons instead of rectangles as their physical shape.http://examples.phaser.io/_site/view_full.html?d=p2%20physics&f=body+debug.js&t=body%20debug Link to comment Share on other sites More sharing options...
Woff Posted September 28, 2014 Author Share Posted September 28, 2014 I bet you're using phaser's arcade physics engine and not P2.Yeah, you are right, it's arcade physics...."... Look at the following P2 example ... " thank you!I'll show result when I'll handle it Link to comment Share on other sites More sharing options...
Woff Posted September 29, 2014 Author Share Posted September 29, 2014 george, do you know some good physics editor/converter for linux? to create model like bunny from example, you'd post yesterday? Link to comment Share on other sites More sharing options...
Woff Posted September 29, 2014 Author Share Posted September 29, 2014 Oh, sorry, I found thesehttp://www.leshylabs.com/apps/sstool/it's very useful I Just wonder how can I use"game.physics.startSystem(Phaser.Physics.P2JS)" with other game objects and activity, such as platform, or player moving & star collecting Link to comment Share on other sites More sharing options...
george Posted September 30, 2014 Share Posted September 30, 2014 One of the most used tools is PhysicsEditor (https://www.codeandweb.com/physicseditor). Use the format Lime + Corona (JSON) to export your files. There is also a plugin for Phaser which you can use to export polygons with some advanced settings (naming, sensors, bitmasks). The folder "resources/PhysicsEditor Exporter" in the phaser download is the plugin. Search the forum in case you want to install it someday. Forgive me for overseeing linux. I do not know about available exporters for that platform. game.physics.startSystem(Phaser.Physics.P2JS) only prepares and starts the physics system so you can use it. Look again at the example, there you will find the linegame.physics.p2.enable([ contra, bunny ], true);This is how you enable specific objects to be part of the physics world. I think you should browse the p2 examples to get a feeling for P2 and then search the forum for more advanced examples like the ones you have already mentioned above. Have fun!Regards George Woff 1 Link to comment Share on other sites More sharing options...
stupot Posted October 1, 2014 Share Posted October 1, 2014 Woff, I can recommend RUBE for physics editing, there are linux/Mac/windows versions. I've used the windows version to generate .json physics files for use by a DirectX/box2d app. I can see they also support Phaser in one of their javascript loaders (demo) though I haven't used this yet. https://www.iforce2d.net/rube/ Woff 1 Link to comment Share on other sites More sharing options...
Woff Posted October 1, 2014 Author Share Posted October 1, 2014 Thank you, George, thank you stupot!Well, I've got new ocupation for my evenings and weekend I will try! Link to comment Share on other sites More sharing options...
Recommended Posts