-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartScene.ino
80 lines (66 loc) · 1.68 KB
/
StartScene.ino
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
const byte Fleche[] PROGMEM = {8,5,B00100000,B01100000,B11111100,B01100000,B00100000,};
uint8_t StartScene()
{
uint8_t cpt = 0;
gb.display.textWrap = true;
while(true)
{
if(gb.update())
{
gb.display.println("I don't remember why i here.");
if(cpt>0)
gb.display.println("I wake up and a monster come help me.");
if(cpt>1)
gb.display.println("Without him I'd be dead.");
if(cpt>2)
gb.display.println("Now i want fight for my freedom!");
if(cpt>3)
break;
if(gb.buttons.pressed(BTN_A))
{
cpt++;
}
}
}
gb.display.textWrap = false;
return 51;
}
uint8_t ChoixMonsterDebut()
{
int8_t cptChoix = 0;
int8_t offset = 0;
while(true)
{
if(gb.update())
{
gb.display.drawBitmap(5,10,Fleche);
gb.display.drawBitmap(75,10,Fleche,NOROT,FLIPH);
gb.display.drawBitmap(30 + offset, 24, GetSpriteMonsterByNumero(cptChoix, true));
if(offset>0) offset -=8; else if(offset<0) offset +=8;
if(gb.buttons.pressed(BTN_LEFT))
{
cptChoix++;
cptChoix = cptChoix%3;
offset = 40;
}
if(gb.buttons.pressed(BTN_RIGHT))
{
cptChoix--;
cptChoix = cptChoix<0 ? 2 : cptChoix;
offset = -40;
}
if(gb.buttons.pressed(BTN_A))
{
break;
}
}
}
ctx->Joueur.AddMonster(0,0,0,0,0,0,0,0);
Monster *m = ctx->Joueur.GetMonster(0);
GenerateStartMonster(m,cptChoix);
monsterVue[cptChoix] = true;
MonsterCatch[cptChoix] = true;
nbVue++;
nbCatch++;
return 0;
}