• Content Count

  • Joined

  • Last visited

1 Follower

About Growler

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Growler

    frame has no offset property

    Figured it out! There was a problem loading a couple animation strings.
  2. Growler

    frame has no offset property

    @obiot @Parasyte In Melon JS 5.1, in the Draw function, I'm getting error: Uncaught TypeError: Cannot read property 'x' of undefined I'm packing the animations in texture packer and have no issues with any other animations. Error is shown below in your engine's code: renderer.drawImage( this.image, g_offset.x + frame_offset.x, // sx <-- ERROR HERE g_offset.y + frame_offset.y, // sy w, h, // sw,sh xpos, ypos, // dx,dy w, h // dw,dh ); Here is an image of the working animation with all of its properties: Here's an image of the problematic animation: Just above, I put an if/else block with logs, and it happens with name: "talk" animation var w = frame.width, h = frame.height; if (!frame.offset) { console.log('Does not have offset: ', frame); } else { console.log('Has offset: ', frame); } I then decided to check the texture map file: game.texture = new me.loader.getJSON('texture'), me.loader.getImage('texture') ); console.log('GAME TEXTURE: ', game.texture); And I see all of my expected animations with their respective offset properties: I did notice, however, that one of the coordinate mappings is missing two objects: there should be "el driver/talk/el driver00.png", "el driver/talk/el driver01.png" and "el driver/talk/el driver08.png when it should be assets el driver00 through el driver12. This could be the issue as it may be looking for and creating a new object without all of its properties? ----------------- EDIT: I see this was discussed four years ago (!topic/melonjs/4AMMxsfPryE), I assume this is not relevant now as entity does not require explicitly passing in spritewidth and spriteheight.
  3. Growler

    Disable respawn on leaving viewport

    @obiot @Parasyte I see, it's happening not because the Taxi is leaving the viewport, but because the mainPlayer entity standing there is left behind, which the viewport eventually leaves. So the question still stands: how can I disable the respawn/refresh if the player, or any entity, is out of bounds?
  4. I have a portion of the game when the camera follows an entity (a taxi), not the main player, as it moves across the screen. The taxi is of type game.VehicleEntity which extends me.Entity.,; As the entity moves left, the camera follows it, which is great. But it reaches a point when the screen fades out and respawns the entity in the center of screen and breaks the game. 1) If the viewport is following the entity, how is the engine determining that it is out of bounds? 2) How can I disable respawning if the entity "leaves" whatever bounds A video of the issue: @obiot @Parasyte
  5. I like the physics and other features that are part of the emitter package: I wanted to show a bird flying off at a random direction and fading away (great for particles) when you near it. Is this possible? @obiot @Parasyte
  6. Growler

    .wav files loaded as .mp3 from game engine

    @obiot but I have a mix of wav, oggs and mp3s. Why can't I load each as an audio file in their own format?
  7. Growler

    .wav files loaded as .mp3 from game engine

    @obiot @Parasyte any ideas on this?
  8. Using MelonJS 5.1, I'm trying to load a .wav audio file named data/bgm/Spywatch_Music_Overworld_v3_Spanish.wav but it's reading it as a .mp3. modules.js:30156 GET 404 (Not Found) My resources object is loaded via Grunt: files: [ { src: ['build/data/bgm/**/*', 'build/data/sfx/**/*'], type: 'audio' }, Which results in game.resources = [ { "name": "Spywatch_Music_Overworld_v3_Spanish", "type": "audio", "src": "build/data/bgm/" }, states "melonJS supports a wide array of audio codecs that have varying browser support : ("mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "mp4", "weba", "webm", "dolby", "flac")." so in game.js I initialize the sound engine as'mp3,ogg,wav'); Why is the engine defaulting to .mp3? Do I have to manually specify the audio file extension? @obiot @Parasyte
  9. Growler

    Music overlays

    @Parasyte @obiot
  10. Growler

    Music overlays

    I'm creating an adventure game that will have a couple different play packs / versions / worlds using MelonJS 5.1. Each pack will have the same baseline overworld music loop, but I'd like to layer on other tracks at the same time. The idea being to add a bit of flare distinction to separate play packs while saving costs on reproducing the same baseline track with subtle differences. The MelonJS Audio API seems basic: Is it possible to be a bit technical with overlaying tracks/fade in/fade out? --------- If not possible through MelonJS engine, do you have other recommendations via Chrome API / web browser APIs to achieve this?
  11. @Parasyte @obiot any thoughts here?
  12. @Parasyte @obiot On Melon 5.1, I want to let the player travel/warp around the same map. They click on a place they want to go, and it loads the player to that location. And really, for any NPC entity, I'd want it to be persistent because I alter property values on the entity and don't want them reset. Except as you can see from the video below, it fades to white twice, but also's length grows by one. It's hard to tell what is being added to array and why. The PlayerEntity isPersistent flag is true, yet it seems to load the player entity again anyway. PlayerEntity instance: this.isPersistent = true console.log('PLAYER RENDERABLE: ', this.renderable); me.LevelEntity instance: Utilities.Main.setSubwayContent((args) => { = args.x; = args.y; this.goTo(); }); ... onFadeComplete: function() { =; =; } ////////////////////////////////////////////////////////////////////////////// If I use levelDirector instead and set the pos on the entity when the new level loads, it goes haywire (see 2nd video). me.LevelEntity instance: Utilities.Main.setSubwayContent((args) => { = args.x; = args.y; this.goTo(); }); ... onFadeComplete: function() { me.levelDirector.loadLevel(this.gotolevel); } game.PlayerEntity = me.Entity.extend({ init: function(x, y, settings) { // call the constructor this._super(me.Entity, 'init', [x, y, settings]); if ( && { this.pos.x =; this.pos.y =; } Question: what's a safe, easy way to respawn the player elsewhere in the map?
  13. Growler

    Minimap for melon v5.1.0

    @Parasyte @obiot any thoughts here?
  14. Growler

    Minimap for melon v5.1.0

    @Parasyte @obiot Ah got it. Is there a way to pixelate / lower the integrity of the minimap render to basic 8 bit colors? I just want to show basic shapes.
  15. Growler

    Minimap for melon v5.1.0

    @Parasyte @obiot 1) Yes. The goal is to call it a single time. I simply need to create a replica of the full Tiled map at smaller scale. 2) Not sure what you mean here. Should I go with Pre-render? If so, how can I do this? RE: "the second parameter is a rect that define the area of the map to draw (and we therefore pass the viewport to it), so the issue here above is that you specificy the rect size accordingly to your canvas/viewport size, where it should the size of the minimap canvas." The minimap canvas should take up the full width of the screen when they click it, so that's why I pass the size of the viewport. See below: the canvas within <div id="screen"> is the game canvas, while the canvas within <div class="full-map"> is the minimap.