-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtitle.js
62 lines (53 loc) · 1.27 KB
/
title.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
56
57
58
59
60
61
62
const TitleScreen = new ex.Scene()
let title = new ex.Actor({
x: screenWidth/2,
y: screenHeight/2.5,
height:200,
width:200,
})
var titleSprite = new ex.Sprite({
image: Characters[1],
// destSize: {
// height: 150,
// width: 150,
// }
})
// titleSprite.scale = ex.vec(1.5,1.5)
title.graphics.use(titleSprite)
title.actions.repeatForever((repeatCtx) => {
repeatCtx.moveBy(0,10,10),
repeatCtx.moveBy(0,-10,10)
})
TitleScreen.add(title)
let titleText = new ex.Text({
text: "Thanks for playing\nour game!\nYou may now return\nto the survey.",
font: new ex.Font({
family: 'Roboto',
size: screenHeight/25,
unit: ex.FontUnit.Px,
textAlign: ex.TextAlign.Center
}),
})
instructions = new ex.Actor({
pos: ex.vec(13*screenWidth/16, screenHeight/1.1),
});
instructions.graphics.use(titleText)
TitleScreen.add(instructions)
const actor = new ex.Actor({
x: 0,
y: 0,
width: screenWidth,
height: screenHeight,
// color: ex.Color.Blue
});
actor.z = -99;
actor.graphics.anchor = ex.Vector.Zero;
var background = new ex.Sprite({
image: Gradients[4],
destSize: {
height: screenHeight,
width: screenWidth,
}
})
actor.graphics.use(background)
TitleScreen.add(actor);