Search the Community

Showing results for tags 'phaser'.



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
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 3,293 results

  1. I am new to coding and I need to know how to make any object or sprite etc. immovable.
  2. I have used this phaser example as a starting point to build a game where shapes are dynamically dropped from the top of the screen and collide with each other: https://phaser.io/examples/v2/p2-physics/pick-up-object What I would like is for the shapes to stop bouncing and vibrating when they collide - but I'm not sure which settings to adjust to achieve this effect (and I've not had much luck with trial and error so far!). I have set gravity like this: game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.gravity.y = 6000; Here is my shapes/sprites json file: { "shapeOne": [ { "density": 2, "friction": 100, "bounce": 0, "filter": { "categoryBits": 1, "maskBits": 65535 }, "shape": [ 84, 76 , 0, 160 , 0, 0 , 84, 0 ] } , { "density": 2, "friction": 100, "bounce": 0, "filter": { "categoryBits": 1, "maskBits": 65535 }, "shape": [ 84, 76 , 314, 76 , 314, 160 , 0, 160 ] } ], "shapeTwo": [ { "density": 2, "friction": 100, "bounce": 0, "filter": { "categoryBits": 1, "maskBits": 65535 }, "shape": [ 0, 0 , 315, 0 , 315, 83 , 0, 83 ] } ], "shapeThree": [ { "density": 2, "friction": 100, "bounce": 0, "filter": { "categoryBits": 1, "maskBits": 65535 }, "shape": [ 0, 0 , 237, 0 , 237, 235 , 0, 235 ] } ] } Does anyone know the correct settings to adjust? Do I need to turn density up really high and friction low? And should gravity be high? Here is a screenshot of the shapes that are being dropped into the container:
  3. QuentinouLeTwist

    Brick Breaker - Choppy effect

    Hi everybody, I started recently playing with game coding using Phaser. This is really a nice framework. My first project is a simple (and opensource) brick breaker you can find out at https://github.com/QuentinouLeTwist/brick-breaker I'm still in the understanding and experimenting steps but one of the effect I do not understand right now is the choppy effect while increasing vertical velocity of the ball (maybe that's not the best practice at all). Visually that's not really nice you know... Also sometimes, the ball does the collision a bit above the paddle, I do not know why. Could it be a difference in the position of the body and the image ? Was thinking first, ok it's framerate issue maybe, but after checking the FPS, it is approaching 60 in game. But again, I'm not so technically advanced with all that to be sure what can be an issue in term of code or performance. The state game code : https://github.com/QuentinouLeTwist/brick-breaker/blob/master/src/states/Game.ts Do not pay attention to the structure of the project, it is still in thinking & refactoring phase. I refactor it again and again to make it clearer & scalable as much as possible but I'm at the beginning of that. So please do not hit me that much if you see some outrageous things, just tell me the right direction if you think I'm going to the wrong path. Hope you can help me. Bests regards and have fun coding !
  4. Shermz345

    Collisions without velocity

    Hi, I'm making a top-down game with the camera that follows the player. Early on, I realized there was a persistent camera jittering effect when using velocity, so I switched my movement to manually change the players x & y coordinates. However, when I started adding enemies to the game that also had arcade physics bodies, I realized that my bodies would not collide. Looking into this, I found this response from the Phaser devs, saying that the problem would be solved in P2. I switched both my bodies to P2, but they still will not collide. Is there a way I can work around both the camera and collisions issue? Thanks in advance for the help.
  5. Hi, I'm making a top-down game with the camera that follows the player. Early on, I realized there was a persistent camera jittering effect when using velocity, so I switched my movement to manually change the players x & y coordinates. However, when I started adding enemies to the game that also had arcade physics bodies, I realized that my bodies would not collide. Looking into this, I found this response from the Phaser devs, saying that the problem would be solved in P2. I switched both my bodies to P2, but they still will not collide. Is there a way I can work around both the camera and collisions issue? Thanks in advance for the help.
  6. Hi all, I was trying to optimize our mobile experience, so instead of including a big background image in on of my texture sheets, I've made it into a simple .jpg image and set that as a CSS background with the following properties : body { margin: 0; padding: 0; background: url('assets/images/bg.jpg') no-repeat center center fixed; background-position: 50% 100%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height: 100%; overflow: hidden; } On iOS and desktop Chrome + Safari, the behaviour is as expected, but on Android Chrome, it seems to affect my Canvas size, as if the canvas was bigger than the whole screen. The weird thing is as I hit refresh multiple times, the behaviour changes from having correct canvas size to incorrect. If there is no way around that, I'm just going to go back to my background being part of my texture atlases. Thanks for any input! Edit: after playing around a bit with how I create Phaser's game object, I just realized that Android does not treat screen density like iOS does (ie. Retina vs xhdpi etc), so I basically added code so that on Android width and height are "100%" with a scale mode of RESIZE, and on iOS width and height are window.innerWidth * window.devicePixelRatio with a scale mode of SHOW_ALL and everything seems to behave correctly now. Let me know if you see any issues with my approach, thanks!
  7. Hey guys, we've made our second HTML5 game. The game itself is written in Phaser. It's a simplified match-3 game (tile popper) with 10 levels and the endless mode. Each level has 3-star rating and it's own unique challenge. Unlocking a challenge gives you an achievement. The endless mode is a beat-the-highscore type of level. We're looking for a sponsor that might be interested in licensing it. You can check it out here: http://overhype.com/games/pop_soap/
  8. Hi, I am trying to modify the 'Pick Up Object' phaser example: https://phaser.io/examples/v2/p2-physics/pick-up-object How it should work is that when a user clicks on one of the shapes at the bottom of the screen it should generate a new shape inside the yellow containing block. I want the shapes to restricted inside the yellow box so that they cannot pass outside. Here is my demo version: http://towerofconfidence.stage.pixeledeggs.com/test/index4.html I have tried the following code - but I am not sure what is going wrong with the boundaries - any help/suggestions would be much appreciated! var game = new Phaser.Game(640, 1139, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); // set the world bounds to match the yellow container game.world.setBounds(167, 0, 306, 500); // center camera game.camera.bounds.setTo(0, 0, 640, 1139); // load the background - this is larger than the screen var mainBG = game.add.sprite(0, -3622, 'mainBG'); // add shapes/buttons to the shapeMenu button1 = game.add.button(80, 760, 'button1', actionOnClickButton, this, 2, 1, 0); button2 = game.add.button(254, 800, 'button2', actionOnClickButton, this, 2, 1, 0); button3 = game.add.button(486, 770, 'button3', actionOnClickButton, this, 2, 1, 0); Then the logic for placing the shapes follows the 'Pick Up Object' example - using PS physics ands boundsCollisionGroup... Thanks!
  9. CodingPark

    GoldenQuest by CodingPark

    GoldenQuest is an educational game for learning the principles of coding while having fun. Play online: https://app.codingpark.io/goldenquest The game canvas is made with Phaser. The code editor is made with dslforge.org and integrated in the game. Here you can see screenshots of one level, the level selector and the level editor. GoldenQuest is a much more advanced version of "the adventures of the pirate robot" that we already showcased here some months ago! Enjoy! Comments and feedback will be appreciated!
  10. Hi, probably I dont fully understand how phaser engine works. For my test I inicialize 10k sprites and than immediately kill them ( sprite.kill() ). Unfortunately I have 15FPS, but I render nothing.. Why I have I have this FPS drop, I need kill sprites and revive it when I need them so I dont need any sprites's update, render, postupdate... functions. The debug plugin says slow around 20ms on preUpload-stage and 20ms postUpdate-stage. Can you someone help me please? Thank you very much Daniel
  11. Hi guys, I just started coding using Phaser and so far, i'm really loving it. So, i'm creating my new game which has a main menu in it and I don't really know where to begin. I know there are lots of packages out there but I would really like to know the basics first before I dive into using tools that are basically "magic" to me. I have tried reading through the code of EZGUI to understand how I would get my desired output, but I haven't reached that level yet so it's quite challenging. I have the spritesheet ready which I will be using for the game window (actually any window) that I got from the free Kenny assets: And what I want is for this to look a little like this, the problem is I don't know where to start. And I would like for the panels to be dynamic depending on the size of the content. I understand that creating the windows, panels, etc.. from any image editor and just be static, but scaling them in-game would affect their quality. Any suggestions will do. I'm still new to Phaser and I would not mind trying out any advice you could give. Thanks!
  12. Welisa Lewis

    Fill a curved Path

    i need help with a game i'm creating. I have used bezier interpolation to create a curved path, it gives a curved path with random coordinates in a particular range. However the issue that i'm facing is that i am able to get the outline of the path however i need to fill the area under the curve so that it look like a solid platform. i really need help with this.
  13. tinygaminggames

    Planning to learn Phaser - need advice

    I came up with this idea for an web application that needs to integrate with a JavaScript game, that's when I came across Phaser. I'm a backend developer by trade but learning JavaScript so any help here will be appreciated. What I'm trying to do: Create a website with ASP.NET and Bootstrap that would allow users to login and manage their profiles. In the member area of the website, you can play this very simple game that I'd like to create using Phaser (hopefully). The actions the user can make in the game will be available depending on the user's "available moves" that are tied to the user's profile. Example - The game will load and gets Billy's information from the session id, Billy has "three moves" that are stored on a SQL DB, to move in the game Billy will hit the "right arrow"(in-game), a HTTP request will check Billy's account to see if he has "available moves", if so, the game will process the request to "move right" and deduct 1 move from Billy's account, if he has no moves, the game will not continue or process the click or touch response. For security reasons I'd like the application server to own the logic of part of the game so that hacking or manipulating of code has to be validated before actions can be made in the game. I hope this makes sense. My question, is Phaser capable of this type implementation? Thank you!
  14. hi im new to programming and phaser im making a game where i need to drag a "chip" onto a "chipreader" and when they overlap hide both and replace with a 3rd sprite which is a "chipped reader" and first i tried funtcion preload(){ game.load.images("chipreader"', images/chipreader) game.load.images("chip"', images/chip) game.load.images("chippedreader', images/chippedreader) } function create() { game.input.mouse.capture = true; game.physics.startSystem(Phaser.Physics.ARCADE); var chipreader=game.add.sprite(260, 535, "chipreader"); chipreader.anchor.setTo(0.5, 0.5); chip.inputEnabled = true; chip.input.enableDrag(true); game.physics.arcade.enable([chip,chipreader]); if (game.physics.arcade.overlap(chip,chipreader )) { chipreader.visible= false chip.visible= false game.add.sprite(260, 535, "chippedreader") }; but nothing happened and i tried so many other ways but it just isn't working :S
  15. zenek24

    ListView- plugin

    [] Im looking for som1 who can explain me how to add this library to game writed in node.js + phaser ( its all about new standars whenever i'm trying to add i get some stupid error's like "Syntax error" with "{" ets - i'll be very gratefull for explain https://phaser.io/news/2016/04/list-view-class
  16. ImprsvIan

    Game seems slow when jumping.

    Hey, Still fairly new to game developing. Trying my hand at it. I've got most of a game created and have figured out a bunch of things. There are two glaring issues I can't seem to get past. My player has gravity applied. If he falls from a certain height and the gravity is high, he falls through the floor tiles. If I turn down the gravity so this doesn't happen, the game seems slow. You can check out a working version of the game at http://gf-game.herokuapp.com/ . I looked into switching to P2 Physics but it just seemed way more complicated than I needed it to be for this type of game. Any help will do.
  17. If I have multiple states (say, 30) that are somewhat resource heavy (audio, background graphic, graphics), is it better to run a single preloader at the start and preload everything I'm going to need in the game, or preload the next state ahead in each state? So if I'm in a room, and can travel to 3 other rooms from my current room, should I be preloading those 3 rooms in my current state while the player is there, etc. or preloading them all in advance?
  18. gauravD

    p2js prismatic springs

    Hi. Prismatic and Spring joints in p2js seem pretty straightforward. I was wondering why using constant rest length, stiffness and damping for a spring would change its behavior when a body's local anchor is changed. Fiddle: http://jsfiddle.net/gauravdixitv/83bkhr3f/ (phaser/p2js template from inkfood) From the fiddle, all the springs use share the same parameters except the local anchor of body A. Why do the springs behave differently? :/
  19. Hey guys, I had related topics before, but let me give a short summary: I am working on a time-based game, roughly similar to guitar hero. For that, I use deltaTime and PhysicsElapsed like this: update: function() { deltaTime = (this.time.elapsedMS)/(1000/60) this.time.physicsElapsed = this.time.elapsedMS*0.001; } So if the framerate drops to 30, deltaTime = 2 and physicsElapsed will also be double the value it is normally (1/60 as in 1/desiredFPS). It always seemed to work perfectly fine. Sure, it leads to a loss of accuracy whith lower framerates or bigger lags, but that's another story. I've tested it with 30fps (forced with a screen capture tool) and it was running at the same speed as it would with 60, so everything is alright. Just yesterday, I found out that when played on a 144hz monitor, the game runs in slow motion. I've checked all the vars above, and I could not find a problem. The game runs at 144 fps, deltaTime is around 0.42 as it should be and physicsElapsed naturally also has the value I expected (0.006999999999999999 for example). But all the motions are at half speed. Or more like 0.42x speed. The spawns, which are also tied to the game time are correct, so no problems there, but everything just moves too slow. The big mistery is: if somebody has a 30hz display, will it run at double speed which wouldn't be playable at all? I just can't think of a reason why this would happen as everything works fine with software caused differences in fps and especially since all the values seem to be in check. Maybe I am overlooking something? Maybe the hardware has some other effect that takes place outside of my code logic? I read that there are issues with other refresh rates, but I was under the impression my code would take care of that. Please help D:
  20. divers

    Animating other players

    Hello, I am creating realtime game using node + socket.io. At the moment I'm trying to figure out how could I animate other players movements. This is how I put other players on map: socket.on('showPlayers', (data) => { for (var key in data.players) { if(key != data.id) players[key] = game.add.sprite(data.players[key].position.x, data.players[key].position.y, 'player', 1); } }); And Updating their positions: socket.on('updatePlayers', (data) => { players[data.id].position = data.position; }); To animate my own player I am simply using: // Player player = game.add.sprite(48, 48, 'player', 1); player.animations.add('left', [3,5], 5, true); player.animations.add('right', [6,8], 5, true); player.animations.add('up', [9,11], 5, true); player.animations.add('down', [0,2], 5, true); Best Regards!
  21. Hi everyone, // If I make grammar mistakes, please excuse me. I'm still not fluent in English ahah I'm a beginner on Phaser, had to have a look into that for my courses. I'm now upgrading a basic tutorial and I want to use a timer (a countdown) in that game but it really doesn't work, it only create a black screen. To do this, I followed this tutorial : https://www.joshmorony.com/how-to-create-an-accurate-timer-for-phaser-games/ I tried other, without success. Some were a bit to hard to understand, others were pretty ugly ! So here is the code I used , can you help me ? : var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('sky', 'assets/sky.png'); game.load.image('ground', 'assets/platform.png'); game.load.image('star', 'assets/star.png'); // on ajoute un diamant game.load.image('dmd','assets/diamond.png') game.load.spritesheet('dude', 'assets/dude.png', 32, 48); } var player; var platforms; var cursors; var stars; var diamonds; var score = 0; var scoreText; var countdown; function create() { // We're going to be using physics, so enable the Arcade Physics system game.physics.startSystem(Phaser.Physics.ARCADE); // A simple background for our game game.add.sprite(0, 0, 'sky'); // The platforms group contains the ground and the 2 ledges we can jump on platforms = game.add.group(); // We will enable physics for any object that is created in this group platforms.enableBody = true; // Here we create the ground. var ground = platforms.create(0, game.world.height - 64, 'ground'); // Scale it to fit the width of the game (the original sprite is 400x32 in size) ground.scale.setTo(2, 2); // This stops it from falling away when you jump on it ground.body.immovable = true; // Now let's create two ledges var ledge = platforms.create(400, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-150, 250, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-100, 510, 'ground'); ledge.body.immovable = true; // The player and its settings player = game.add.sprite(32, game.world.height - 150, 'dude'); // We need to enable physics on the player game.physics.arcade.enable(player); // Player physics properties. Give the little guy a slight bounce. player.body.bounce.y = 0.2; player.body.gravity.y = 350; player.body.collideWorldBounds = true; // Our two animations, walking left and right. player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); // Finally some stars to collect stars = game.add.group(); // We will enable physics for any star that is created in this group stars.enableBody = true; // Here we'll create 12 of them evenly spaced apart for (var i = 0; i < 10; i++) { // Create a star inside of the 'stars' group var star = stars.create(i * 70, 0, 'star'); // Let gravity do its thing star.body.gravity.y = 15; // This just gives each star a slightly random bounce value star.body.bounce.y = 0.2 + Math.random() * 0.2; } // On ajoute les diamants diamonds=game.add.group(); diamonds.enableBody=true; // création des diamants dans l'espace de jeu for (var i = 0; i < 3; i++) { var dmd = diamonds.create(i * 70, 0, 'dmd'); dmd.body.gravity.y = 30; dmd.body.bounce.y = 0.1 + Math.random() * 0.2; } countdown.startTime = new Date(); countdown.totalTime = 120; countdown.timeElapsed = 0; countdown.createTimer(); countdown.gameTimer = game.time.events.loop(100, function(){ countdown.updateTimer(); }); // The score scoreText = game.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000' }); // Our controls. cursors = game.input.keyboard.createCursorKeys(); } function update() { // Collide the player and the stars (et les diamants du coup) with the platforms game.physics.arcade.collide(stars, platforms); game.physics.arcade.collide(diamonds, platforms); game.physics.arcade.collide(player, platforms); // Checks to see if the player overlaps with any of the stars, if he does call the collectStar function game.physics.arcade.overlap(player, stars, collectStar, null, this); // idem pour les diamants game.physics.arcade.overlap(player, diamonds, collectDiamonds, null, this); // Reset the players velocity (movement) player.body.velocity.x = 0; if (cursors.left.isDown) { // Move to the left player.body.velocity.x = -150; player.animations.play('left'); } else if (cursors.right.isDown) { // Move to the right player.body.velocity.x = 150; player.animations.play('right'); } else { // Stand still player.animations.stop(); player.frame = 4; } // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -350; } } function collectStar (player, star) { // Removes the star from the screen star.kill(); // Add and update the score score += 10; scoreText.text = 'Score: ' + score; } function collectDiamonds (player, dmd) { dmd.kill(); score += 50; scoreText.text = 'Score: ' + score; } function createTimer(){ var countdown = this; countdown.timeLabel = countdown.game.add.text(countdown.game.world.centerX, 100, "00:00", {font: "100px Arial", fill: "#fff"}); countdown.timeLabel.anchor.setTo(0.5, 0); countdown.timeLabel.align = 'center'; } function updateTimer (){ var countdown = this; var currentTime = new Date(); var timeDifference = countdown.startTime.getTime() - currentTime.getTime(); //Time elapsed in seconds countdown.timeElapsed = Math.abs(timeDifference / 1000); //Time remaining in seconds var timeRemaining = countdown.timeElapsed; //Convert seconds into minutes and seconds var minutes = Math.floor(countdown.timeElapsed / 60); var seconds = Math.floor(countdown.timeElapsed) - (60 * minutes); //Display minutes, add a 0 to the start if less than 10 var result = (minutes < 10) ? "0" + minutes : minutes; //Display seconds, add a 0 to the start if less than 10 result += (seconds < 10) ? ":0" + seconds : ":" + seconds; countdown.timeLabel.text = result; if(countdown.timeElapsed >= countdown.totalTime){ // On cherche la fin du timer result = "Rate !"; } }
  22. I'm working on puzzle game about a professor trapped in hamster's body Current prototype is hosted on gamejolt https://gamejolt.com/games/hamsternikus/306047 Please try it and give me a feedback on the following issues: - Are controls responsive and intuitive? Whether it could be a good idea to use keyboard controls for desktop version? - Is gameplay boring? - Are puzzles tough? You can follow development process on gamejolt devlog https://gamejolt.com/games/hamsternikus/306047/devlog Or in my twitter @kpded
  23. eazylow

    [Phaser] Neon Dunk is here

    Hello! I'm glad to present you my new game Neon Dunk: http://powerthemes.eu/neondunk Both exclusive and non-exclusive licenses are available for now.
  24. SamSnowy

    'Sprite.world' gives 0 at first

    So my problem is that I have a sprite that is giving me 0 for sprite.world.x and sprite.world.y (although it clearly isn't at 0,0). What's weird is that printing out the sprite.world.x gives 0 at first but adding a delay of 50ms it gives me the correct position (in case you're wondering nothing is happening during the delay) Below is the code snippet that i am using (just to be 100% sure). Basically I have a group (located at a certain position) with a specific rotation that has a sprite (the one I'm having issues with) at a certain location. The first printed out value is 300 (which obviously isn't true). I added a delay of 50 ms after the last line then printed out newR.world.x and got the correct value (813). The provided code snippet is the last thing I have in my create function (and the update function is empty). As stated previously nothing is happening by the time the delay starts till it ends (I am only left with the preload function).
  25. SamSnowy

    'Sprite.world' gives 0 at first

    So my problem is that I have a sprite that is giving me 0 for sprite.world.x and sprite.world.y (although it clearly isn't at 0,0). What's weird is that printing out the sprite.world.x gives 0 at first but adding a delay of 50ms it gives me the correct position (in case you're wondering nothing is happening during the delay) Below is the code snippet that i am using (just to be 100% sure). Basically I have a group (located at a certain position) with a specific rotation that has a sprite (the one I'm having issues with) at a certain location. The first printed out value is 300 (which obviously isn't true). I added a delay of 50 ms after the last line then printed out newR.world.x and got the correct value (813). The provided code snippet is the last thing I have in my create function (and the update function is empty). As stated previously nothing is happening by the time the delay starts till it ends (I am only left with the preload function). Note: I accidentally posted my question twice please ignore the duplicate. ( I couldn't find a delete button for my duplicate post)