-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathobjects.js
55 lines (40 loc) · 1.01 KB
/
objects.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
game.addEventListener("load", function(){
// A pit of dispair
pit = new Sprite(16, 16)
pit.image = game.assets['images/map.png']
pit.frame = 9
pit.x = 16 * 5
pit.y = 16 * 5
game.rootScene.addChild(pit)
function pitframe() {
if ( character.intersect(pit) ) {
}
}
pit.addEventListener("enterframe", pitframe)
// A moveable pot
pot = new Sprite(16, 16)
pot.image = game.assets['images/map.png']
pot.frame = 26
pot.x = 16 * 10
pot.y = 16 * 10
potVisible = false
function potframe() {
if ( character.intersect(pot) ) {
character.blocked = true
}
}
pot.addEventListener("enterframe", potframe)
// Some flowers
flowers = new Sprite(16, 16)
flowers.image = game.assets['images/map.png']
flowers.frame = 18
flowers.x = 16 * 2
flowers.y = 16 * 10
game.rootScene.addChild(flowers)
function flowersframe() {
if ( character.intersect(flowers) && !potVisible) {
potVisible = true
}
}
flowers.addEventListener("enterframe", flowersframe)
})