<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script src="rpg-beta-2.js"></script>
<script>
var rpg;
RPGJS.load(function() {
rpg = new Rpg("canvas_rpg");
rpg.loadMap('MAP010', {
tileset: '023-FarmVillage01.png',
events:['EV029','EV030'],
player: {
x: 13,
y: 5,
filename: '001-Fighter01.png'
}
}, function () {
rpg.setScreenIn("Player");
});
});
</script>
</head>
<body>
<canvas id="canvas_rpg" width="640px" height="480px"></canvas>
</body>
</html>
EV029.json
[
{
"x": 5,
"y": 6,
"id": "29",
"name": "EV029"
},
[
{
"character_hue": "182-Rock01.png","pattern": 0,
"trigger": "action_button",
"direction": "bottom",
"frequence": 16,
"type": "fixed",
"through": false,
"stop_animation": false,
"no_animation": false,
"direction_fix": false,
"alwaysOnTop": false,
"speed": 4,
"commands": [
"MOVE_ROUTE: ['step_backward']",
""
]
}
]
]
EV030.json
[
{
"x": 13,
"y": 7,
"id": "30",
"name": "EV030"
},
[
{
"character_hue": "174-Chest01.png","pattern": 0,
"trigger": "action_button",
"direction": "bottom",
"frequence": 16,
"type": "fixed",
"through": false,
"stop_animation": false,
"no_animation": false,
"direction_fix": false,
"alwaysOnTop": false,
"speed": 4,
"commands": [
"SELF_SWITCH_ON: 'A'"
]
},
{
"conditions": {"self_switch": "A"},
"character_hue": "174-Chest01.png","pattern": 0,
"trigger": "action_button",
"direction": "up",
"frequence": 16,
"type": "fixed",
"through": false,
"stop_animation": false,
"no_animation": false,
"direction_fix": false,
"alwaysOnTop": false,
"speed": 4,
"commands": [
]
}
]
]