Questions tagged [melonjs]

melonJS is an open-source HTML5 based community game engine.

Resources

26 questions
7
votes
1 answer

RPG - storing player data for semi-complex tree structure

I'm making a web RPG in js, using melon JS and SQL DB with PHP. This question is about how to store completed and current tasks per non-player character (NPC). NPC dialog and task data: all dialog is stored in a js object in the following…
user3871
  • 12,432
  • 33
  • 128
  • 268
3
votes
2 answers

Confused on prototype bindings, this statement

In the following code, I'm wondering how context is bound to this: In obj.myMethod();, context is given to the object. So logging it gives the object. In var myFun = obj.myMethod; then myFun();, context is given to the Window. The only difference…
user3871
  • 12,432
  • 33
  • 128
  • 268
2
votes
1 answer

How to change color of a sprite over time in melonJS

I want to add some trail effect to a moving object that will fade over time. This is what I've got so far: game.Trail = me.Entity.extend({ init:function (x, y, settings) { this._super(me.Entity, 'init', [ x, y, { image:…
chipairon
  • 2,031
  • 2
  • 19
  • 21
2
votes
1 answer

Framework for html5/canvas game based on hexagonal grid

I am developing html5 game based on hexagonal grid. After some investigation I have used : MelonJS + Tiled + this tricky thing. Everything seems good in this combination, until I started to think about dynamic showing some hexagons, that my player…
Maksym
  • 4,434
  • 4
  • 27
  • 46
2
votes
1 answer

How to disable a character movements MelonJS temporarily?

I am developing a game with Melon.Js, and down the canvas where it is loaded, I create a chat window. The problem is that when I type in the , if I press AWDS keys the character moves. Does anyone know how to temporarily disable (as long as the chat…
edme88
  • 33
  • 5
1
vote
1 answer

MelonJS debug mode

I'm using melonJS ( v3.x ) to develop my HTML5 game. All is working fine in debug mode ( http://something:8000/#debug ), but if i test without de debug panel ( http://something:8000/ ), my scene is loaded and rendered but none of my events work (…
user2733521
  • 439
  • 5
  • 22
1
vote
1 answer

Programmatically insert entities in melonJS

I have been working my way through the melonJS tutorial while keeping my application in mind in the back of my head. I want to be able to add entities programmatically rather than specifying them in the .tmx file that gets loaded in for each level. …
Tore
  • 1,236
  • 2
  • 11
  • 21
1
vote
1 answer

melonJS unclear on use of "this" and constructor calling

I'm following this melon JS tutorial, and am on part 3. I am not clear on a couple things in this code snippet game.PlayerEntity = me.ObjectEntity.extend({ init: function(x, y, settings) { this.parent(x, y, settings); ... more…
user3871
  • 12,432
  • 33
  • 128
  • 268
1
vote
1 answer

game.HUD = game.HUD || {} meaning

I'm following melon js tutorial. This is at the top of my HUD.js file. game.HUD = game.HUD || {} I've seen this before in other examples. What does the namespace.something = namespace.something || {} syntax mean and why is it needed?
user3871
  • 12,432
  • 33
  • 128
  • 268
1
vote
1 answer

How to save to disk in a JSON format file in Windows Store app (using WinJS)?

I've created a game based on HTML5+JS using melonJS for Windows8. But, how do I save player's persisting game data into the disk file (preferably localFolder). I've read the sample given in the MSDN forum, but there's no mention about saving it to…
ayakashi-ya
  • 261
  • 3
  • 18
0
votes
1 answer

Melon.js Space Invaders Project - Grunt config is clearing resource file

I was trying to replicate the Space Invaders Project of Melon.js. It uses Grunt and the initial configuration is clearing the file that contains the player images. resources: { dist: { options: { dest: 'build/js/resources.js', …
Ana Gomez
  • 52
  • 7
0
votes
1 answer

how to bind a player position to a shader with melonjs?

I've created a glsl shader as: