-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsketch2.js
More file actions
90 lines (53 loc) · 1.27 KB
/
sketch2.js
File metadata and controls
90 lines (53 loc) · 1.27 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
p5.disableFriendlyErrors = true
/*
esse é o main
TODOS:
-animação relativa a player no player.js e inimigo em inimigos.js
-animar um createGraphics() e plotar isso no sprite e não animar os sprites,
qdo animar o sprite vai tudo junto
-carregar imagens no preload()
*/
var rotation = 100
var gui
function preload ()
{
}
function setup()
{
//
createCanvas (800,600);
noSmooth()
iniPersonagem();
initMundo()
iniUi()
// gui = createGui ()
// gui.addGlobals ('rotation')
// sliderRange (0,360,10)
// gui.addGlobals ('personagem.corpo.bracoesquerdo.rotation' )
iniInimigos()
doAnimIni()
//doGreedynomicon()
}
function draw()
{
camera.x = personagem.x
camera.y = personagem.y
background (0);
camera.on();
//allSprites.debug = true
tint(240+ noise (frameCount)*300,240+ noise (frameCount)*300,140+ noise (frameCount)*200)
//gparedes.debug = true
camera.zoom = 2.5;
//allSprites.draw();
//o codigo abaixo possibilita vc mudar de cor apenas um pedaço do personagem
//tint (200,10,10)
//personagem.corpo.cabeca.draw()
//personagem.corpo.bracoesquerdo.rotation = rotation
drawMundo();
drawInimigos();
drawPlayer()
drawGreedynomicon();
drawSpotlight();
drawVida()
drawUI();
}