Wahyu Hidayat

Members
  • Content Count

    5
  • Joined

  • Last visited

About Wahyu Hidayat

  • Rank
    Newbie

Recent Profile Visitors

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

  1. Wahyu Hidayat

    Can't Add Image Layer from PNG

    I'm using melonJS 6.1.0, sorry Mr. obiot for bothering your time, i've figured out my mistake, it was not about the imageLayer implementation, it's about my player update. When i use: me.game.viewport.moveTo (0, this.pos.y); I got an error like before, but when i change it to: me.game.viewport.pos.y = this.pos.y; the game was running perfectly. And I got that error only if i instantiate the background and player together. Like this: me.game.world.addChild (new me.ImageLayer (0, 0, { image: 'background' }), -1); me.game.world.addChild (me.pool.pull ('player', 0, 0, { image: 'player', width: 10, height: 10, framewidth: 10, frameheight: 10 }), 1); If i just instantiate one of them, me.game.viewport.moveTo (0, this.pos.y); also works fine. I don't know why. But thank you for helping me, my problem has been solved
  2. Wahyu Hidayat

    Can't Add Image Layer from PNG

    My concern is about my implementation. Is it the right implementation? or i did some mistake on parameter there. Because the error is: Uncaught o {name: "me.Vector2d.Error", message: "invalid x,y parameters (not a number)"} Anyway, my game resource is below and i can display my player sprite in the game: game.resources = [ { name: 'player', type: 'image', src: 'data/img/player.png' }, { name: 'background', type: 'image', src: 'data/img/background.png' } ];
  3. Wahyu Hidayat

    Can't Add Image Layer from PNG

    I can't instantiate an image layer from .png file. Is it right? me.game.world.addChild (new me.ImageLayer (0, 0, { image: 'background' }), 1); I can't get the documentation clearly from http://melonjs.github.io/melonJS/docs/me.ImageLayer.html, I want to create a scrollable background, i looked at tutorial from http://melonjs.github.io/tutorial-platformer/ but i just get the load process from TMX, i just want from normal png, can anyone help me, thank you. I've add the resource image 'background' to game.resources and load it successfully, because other image file there can be displayed by entity/sprite in my game.