Jump to content

Search the Community

Showing results for tags 'player'.

  • 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. Hello, i have this script which is based on the tutorial: i want the player to navigate through the world, but it's constrained to a 800x600 box, (as this is the world WxH), the "game" world is a GIF 4096x3500. maybe this is not the correct way, could you please lead me into the correct way? this is the code: http://cypunkdb.net/t/phaser/tut1b/part7.html thanks
  2. Hello, so what I am trying do is quite simple I think I just don't know the best way to execute it. I want the camera to follow the bullet up until it dies/takes impact to the enemy or boundary then the camera is handed back to the player. I tried an if statement about the bullet being alive and else it would return to the player and that caused the bullet to be stuck on itself. I have additional code as well in the beginning to tell it to follow the player as well as this code in the beginning not too sure if this is causing an overlap or what. game.camera.follow(player(); //weapon
  3. I am looking for some guidance or example of how to integrate into my game the ability for users to create their own "player." I would like them to be able to select a character and then be able to customize that character (change hair; shape; body etc) prior to playing. I have searched extensively but have been unsuccessful in locating any assistance/tutorials/examples online for this type of action.
  4. Hi, I'm a actually making a game using PHASER. On this game, player have to jump to escape balls rolling on the ground, like on an infinite runner. Actually, everything is working fine but the player is showed using a spritesheet divided on 128*128 resolution. The character animation running doesn't use 128 pixels on width causing the ball to collide with the player even if the player doesn't hit the ball. The player hitbox is actually configured to 128*128 but I know that in previous versions of PHASER, it was possible to render player to make his hitbox scale his skin. I didn't fin
  5. Hello, I've started using phaser just recently, I'm making a RPG game, and so far I've been learning how to make tilemaps, use spritesheets, animate sprites, and I'm falling in love with the framework, I just have a little problem. My player is set to collide with World Bounds, and it works for every bound, except the top one. I'm using the es6 webpack template, here's my, so far piece of code. create() method of my Game.js class. (I have nothing else in update, since I manage that in my own Sprite Class) this.game.world.setBounds(0, 0, 100 * 32, 100 * 32) this.game.
  6. I'm still new to Phaser and coding in general so I apologize if this doesn't make sense. I have player gravity and bounce set to 0 and movement velocity cranked up so movement seems instant. I'm looking to make it so that once the player hits a certain point on the x axis it stops, then the movement key must be pressed again to continue in either direction until it hits another one of those points, and so on. One idea I had was to populate the screen with vertical immovable bars with collision spread out evenly, but I don't know how to make it so that once the player hits them and stops
  7. Hi, I'm creating a game that player can walk over terrains with lots of slopes. How can I make my player rotate accordingly to the angle of the slope? This is how it's currently working: And this is how is must work (I've changed the angle manually): I'm using Box2D plugin to generate the terrain accordingly to an image. That's the reason of all these bodies. Thanks!!
  8. help with collision. When I add collision it's layer has offset (or not work). You can show demo in https://game.tlgrm.info/phaser.html. var game = new Phaser.Game(900, 600, Phaser.AUTO, 'gameTroll', { preload: preload, create: create, update:update, render:render}); function preload () { game.load.tilemap('level', 'assets/level.json', null, Phaser.Tilemap.TILED_JSON); game.load.spritesheet('dude', 'assets/NPC.png', 16, 32); game.load.image('snow-expansion', 'assets/snow-expansion.png'); game.load.image('tiles_packed', 'assets/tiles_packed.png'); } var c
  9. I'm creating an infinite scroller and (among other things) I'm having trouble with deducting player lives. I've looked at various tutorials, but most of them seem to kill the player whenever they hit an obstacle. Ideally, I'd like to deduct a life from the player until they have no more lives. The problem I'm experiencing is that I'm checking overlap with the player and a pool of enemies (btw, works the same way if I check for collision). In the callback, I only want to deduct a life the first time the player comes in contact with the enemy. What's happening now is that a single contact w
  10. Hi, Im making a platformer in Phaser and have successfully loaded a tilemap but my player doesn't collide with the tilemap layer. Here's my code. var game = new Phaser.Game(304, 208, Phaser.AUTO, 'game', { preload: preload, create: create, update: update, render: render}); function preload() { this.game.load.atlas('player', 'assets/player/player_full.png', 'assets/player/player_full.json'); game.load.image('bg', 'assets/bg-LONG.jpg'); // TILEMAP game.load.tilemap('world', 'assets/tilemaps/world.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('world_tiles', 'a
  11. Hi, I have an idea of a game in which there would be a player who could collect different items(boots, helmet, pants, etc) It would really be a pain if I had to draw: 10 animation frames for normal character, 10 animation frames for character in boots, 10 animation frames for character in pants, 10 animation frames for character in pants,in boots, And so on..... You got me..(Of no, think of Minecraft or Terraria or Starbound where you can wear armor and stuff) So, my question is - Is it possible(in Phaser) to take different images(One for body, one for head, one for legs) and p
  12. Hello! I am making my first ever game and am having trouble getting my character to lose points. In the game, the character can collect two types of bottles. One of them rewards them points, while the other one I want to take away points. However, after doing the codes, my character is still getting points from collecting the wrong bottles (the ones that should take points away) This was the code I am using to take points from the player (it is in the update function) function collectbottle (player, bottle) { // Removes the bottle from the screen bottle.kill(
  13. Hello I am trying to develop a FPS using BabylonJS and CannonJS in TypeScript. My first problem was what type of Impostor to use as the player, end up using a Cylinder with a FixedRotation = true. Now I place the camera on top off the Cylinder on every frame, and apply Impulses to the Cylinder based on keyboard input, and camera target. The algorithm that I came up is the flowing (hero = Cylinder): scene.registerBeforeRender(function () { //Your code here //Step camera.position.x = hero.position.x; camera.position.y = hero.position.y + 1.0;
  14. Contract programmers to develop multiplayer card games. early pagametno
  15. I am trying to move my player diagonally when I press down the 'up' & 'left' arrow keys. My current code is this this.moved = false; if (this.cursors.up.isDown) { this.moved = true; this.player.body.velocity.y -= 100; this.player.play('up'); } if (this.cursors.down.isDown) { this.moved = true; this.player.body.velocity.y += 100; this.player.play('down'); } if (this.cursors.left.isDown) { this.moved = true; this.player.body.velocity.x -=
  16. I am new to phaser so sorry if this seems like a newb question. I have searched for this with no luck. Maybe I just dont know what I am looking for yet. After creating the world map, I have a bigger map than the player can see. As the player reaches the edge of the map, the player can go outside of my set jpg map that is a width of 5000 pixels by 5000 pixels and can see black past the edge One: How can I keep the player inside the edge of the map and Two: how do I set the map so as the player navigates to the end of the maps edge the map stops showing what is past it This is just
  17. I'm trying to make a Missile that will follow the player. My problem is that I don't know how to get the player position inside Missile object. I will paste my code below and write a comment where the problem is: window.onload = function() { var GameState = function(game) { }; // Here is a custom game object Player = function (game, x, y) { Phaser.Sprite.call(this, game, x, y, 'player'); }; Player.prototype = Object.create(Phaser.Sprite.prototype); Player.prototype.constructor = Player; /** * Automatically called by World.update */ Player.prototype.update = function() { // this.angl
  18. Hi, I'm new and my English isn't very good... I hope you will understand what I'm trying to do. I'm doing a html5 game like Metal Slug, or something like that, and I want a specific behaviour which I found in http://test.xapient.net/phaser/attm/. I know this game was made by a member of this forum (@valueerror) so I hope he can help me. The behaviour I want is the one made by Mario who is able to walk to the middle of the screen and then he stop moving forward and now is the "world" who is moving. Sorry about my English and thank you very much!!!
  19. Hey everyone! I'm making a top-down game with waves, but the problem is the enemy AI. As it stands now the enemy rotates and goes towards the player, but when they all go after the player they come close to each other and it looks silly, like this: The thing is that I want the enemies to avoid eachother so they don't collide. If anybody knows how to do this, help is really appreciated! this is my code for their behavior: enemy1Group.forEachAlive(function (enemy) { enemy.body.rotation += 20, enemy.body.collideWorldBounds = true, enemy.body.veloc
  20. I've got npc's that can go offscreen when player moves left/right but as they go out of bounds collision stops working on ground and they end up colliding with the world bounds, what would be the best way to handle them? do i save their positions on outOfBounds? or disable gravity for them or somehow keep ground collisions working out of camera?
  21. Good day guys, I'm customizing Flying Dog, I've gone throught the tutorials and documentation. Still a bit unclear on how to implement something. After the round ends, when I click restart. I want another plane to be used for the reminder of the game. I know I have to add it to assets.js, and then objects.js under this.sprite. However I'm not sure how to enable the new plane on a button action or restart. On restart button click - it's loads game.system.setScene(SceneGame); So I was trying to however load another scene, however I think that would be overkill, all I want is a diff
  22. Hello, I am trying to make an entity class which holds the textures, player data, etc. I keep getting "Uncaught TypeError: undefined is not a function" in chrome which I am not sure how to fix it. Works perfectly in VS2013. This is a typescript project. GameState.Ts: module TinyRpg.State { export class GameState extends Phaser.State { public _player: TinyRpg.Entity; constructor() { super(); } preload() { this._player = new TinyRpg.Entity(this.game, EntityType.Player, 0); } render() { this._player.draw(); } }} Entities.Ts: enum EntityType { Player
  23. Hello everyone, it's me again.. i think my last post wasn't very clear .. i need help see i'm using this code (PLAYER) player = this.game.add.sprite(32, game.world.height - 150, 'dude'); game.physics.arcade.enable(player); player.body.bounce.y = 0.2; player.body.gravity.y = 1200; player.body.collideWorldBounds = true; player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); Now i want to attach a gun with him, infront of him so i just used this code gun = game.add.sprite(player.x + 45, player.y + 55, 'DE'); somehow, player.addChild(gun); is
  24. blaspix


    Hi everyone, Panda.js Sequencer is a plugin for Panda.js HTML5 game engine. The plugin goal is to provide an easy way to animate a sprite with spritesheet sequences. You can download it on github. https://github.com/blaspix/panda.js-sequencer
  • Create New...