okaybenji

Members
  • Content Count

    8
  • Joined

  • Last visited

About okaybenji

  • Rank
    Newbie

Contact Methods

  • Twitter
    okaybenji

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Presenting GOODNIGHT, a short, retro puzzle-platformer made in the style of an NES game. Play it here! The game supports keyboard controls and gamepads, and you can play in the browser or download for Mac. It has been a couple years since I last shared a game here. I previously worked with the pixel artist Adam Bing on bitbout, which was developed with Phaser 2 for the LOWREZJAM. We got together again this year to do GOODNIGHT for the A Game By Its Cover jam, this time in Phaser 3. If you want to read a little bit about development of the game, I posted a dev log over on itch.io. Thanks for taking a look!
  2. Looks great! Do you have a Twitter or something where I can follow progress on the game you're working on?
  3. FYI, each part of your exocraft has its own condition status. As it takes damage, it will darken from impacts. Eventually it will start smoking and catch fire, then finally get destroyed. At any time before it blows up you can head back to the hangar to repair individual parts or the whole ship.
  4. Thanks so much for taking the time to respond! 1) As obvious as it seems in hindsight, 'take a look at the code' is actually great advice. I will do that. 2) Ah yes, I see setCollisionByExclusion makes a lot more sense, thanks! However, I'm still getting the same result... Can you tell whether I am doing something else wrong?Here's what my code looks like currently: const Play = (game) => { let player; let boundary; const factories = { entities: { player: require('../factories/entities/player'), }, keys: require('../factories/keys') }; const play = { create() { const map = game.add.tilemap('dungeon'); map.addTilesetImage('dungeon', 'dungeon'); map.createLayer('Base'); boundary = map.createLayer('Bounds'); map.createLayer('Decorations'); map.createLayer('Foreground'); game.physics.startSystem(Phaser.Physics.ARCADE); map.setCollisionByExclusion([], true, boundary); const bounds = {x: 0, y: 0, width: 512, height: 512}; player = factories.entities.player({ sprite: game.add.sprite(250, 250), keys: factories.keys(game), gamepad: game.input.gamepad.pad1, game }); game.physics.arcade.enable(player); }, update() { // collide entities game.physics.arcade.collide(player, boundary, () => { console.log('colliding!'); // <- Never gets logged. }); } }; return play; }; module.exports = Play; 3) I actually do have a title screen, though I've tracked the problem to my trying to be clever and calculate the width and height of my animation frames. My filenames include the name of the animation and the number of frames in it, and I create a temporary image to get its width and height in pixels. But on the first load, the width and height come through as 0 for some reason. I wonder if there's any way to make this work without causing the issue... Here's the code if you care to take a look. const spritesheets = [ // TODO: access the filesystem to build this array automatically 'player/walk_e-2.png', 'player/walk_n-2.png', 'player/walk_s-2.png', 'player/walk_w-2.png', ].map((asset, i) => { const slash = asset.indexOf('/'); const underscore = asset.indexOf('_'); const dash = asset.indexOf('-'); const dot = asset.indexOf('.'); const entity = asset.slice(0, slash); const name = entity + '_' + asset.slice(slash + 1, dash); const frameCount = Number(asset.slice(dash + 1, dot)); const path = '../../assets/images/' + asset; const image = (function() { const image = new Image(); image.src = path; return image; }()); return { entity, name, frameCount, image }; }); spritesheets.forEach(({ name, image, frameCount }) => { const path = image.src; const width = image.width / frameCount; const height = image.height; game.load.spritesheet(name, path, width, height); });
  5. Hi, there! Hope this is the right place to seek Phaser help. If not, I'm happy to move my post. I have three issues I'm trying to troubleshoot: First, the camera LERP system centers my player when I'm walking left or upward, but when I'm walking right or downward, it allows the player to get and stay close to the right/bottom edges of the screen. Second, I can't seem to get my character to collide with the layer I created in Tiled specifically for collisions. The character just walks right over the boundaries as though they are not there. Third, when I load up my game for the first time, the player character (and also any other entities which have sprite-based animations) shows up as his entire spritesheet rather than just one (animated) frame. After refreshing the browser, the character and other entities look normal and their animations work correctly. I would guess it has something to do with loading order/caching of assets? Has anyone seen this issue before? I haven't included the player here, but it's basically just a sprite which gets some custom properties and methods attached to it and then is returned. I'm happy to include more code if it's helpful! Thanks for taking a look! // Play state. const Play = (game) => { let player; let boundary; const factories = { entities: { player: require('../factories/entities/player'), }, keys: require('../factories/keys') }; const play = { create() { const map = game.add.tilemap('dungeon'); map.addTilesetImage('dungeon', 'dungeon'); map.createLayer('Base'); boundary = map.createLayer('Bounds'); map.createLayer('Decorations'); map.createLayer('Foreground'); game.physics.startSystem(Phaser.Physics.ARCADE); map.setCollisionBetween(1, 100000, true, 'Bounds'); const bounds = {x: 0, y: 0, width: 512, height: 512}; player = factories.entities.player({ sprite: game.add.sprite(250, 250), keys: factories.keys(game), game }); game.physics.arcade.enable(player); // camera lerp game.world.setBounds(bounds.x, bounds.y, bounds.width, bounds.height); game.camera.follow(player, Phaser.Camera.FOLLOW_LOCKON, 0.02, 0.02); }, update() { game.physics.arcade.collide(player, boundary); } }; return play; }; module.exports = Play;
  6. Hey, I'm not the one complaining about missing features! ;D But jokes aside, I actually do have a few items on my to-do list for the Phaser engine! Oh, and thank you so much for making this awesome engine and sharing it with the community <3
  7. https://okaybenji.itch.io/bitbout A single-screen, local competitive platformer 2-4 players duke it out while trying not to fall to their doom. Each player has 3 lives and limited HP. Last bit standing wins! Code, design and music by Benji Kay. @okaybenji Art and animation by Adam Bing. @Exciteless Source code is on Github. Written with Phaser, with chiptune2.js for SFX and music. Supports PS4 DualShock 4 and Xbox One controllers! This is my first game release. I would love to hear some feedback. Thanks so much for taking a look!