-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialogueScene.js
More file actions
53 lines (46 loc) · 968 Bytes
/
Copy pathdialogueScene.js
File metadata and controls
53 lines (46 loc) · 968 Bytes
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
const backDia = new Image()
backDia.src ="./img/battleBackground.png"
let cutsceneimage= new Image()
cutsceneimage.src="./img/wizard.png"
let bg = new Sprite({
position: {
x: 0,
y: 0
},
image:backDia,
scale:2
})
let wz = new Sprite({
position: {
x: 500,
y: -200
},
image:cutsceneimage,
scale: 2,
frames:{
max:5,
hold:60
},
animate:true
})
function dialogue(){
gsap.to('#overlappingDiv', {
opacity: 1,
onComplete: () => {
gsap.to('#overlappingDiv', {
opacity: 0,
onComplete:()=>{
bg.draw()
wz.draw()
}
})
}
})
}
function reset(){
document.querySelector("#CharacterDialogueBox").style.display = "none"
bg = null;
wz=null;
player.interactionAsset.hasInteracted = true;
window.requestAnimationFrame(animate)
}