-
Notifications
You must be signed in to change notification settings - Fork 0
/
rika.py
48 lines (36 loc) · 1.75 KB
/
rika.py
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
import pygame
pygame.init()
from menu import *
from character import Character
from variables import *
# sprites
sprites = {'intruguing_normalRika': pygame.image.load('Rika Sprites/ri_se_de_a1.png'),
'smiling_normalRika': pygame.image.load('Rika Sprites/ri_se_ni_a1.png'),
'superSmiling_normalRika': pygame.image.load('Rika Sprites/ri_se_wa_a1.png'),
'littleSad_normalRika': pygame.image.load('Rika Sprites/ri_se_ko_a1.png')
}
quiz_sprites = {
False: pygame.image.load('Rika Sprites/ri_se_ko_a1.png'),
True: pygame.image.load('Rika Sprites/ri_se_wa_a1.png'),
}
class Rika(Character):
def general(self, window, object, sprites_chosen, buttons, moves, letters, dialogue, restart, sounds):
# change sprites
sprite = sprites_chosen.get(object.clicks, 'smiling_normalRika')
if object.answered:
sprite_used = quiz_sprites[object.gotItRight]
else:
sprite_used = sprites[sprite]
x = 100
y = HEIGHT - sprites[sprite].get_height()
draw_button(window, BLACK, "menu", 20, 20, 200, 50, buttons)
object.draw_character(sprite_used, window, x, y, object.move)
object.draw_chatbox(window, WIDTH/2 - 300, HEIGHT - 120)
object.draw_text(window, dialogue, quiz_interactions, quiz_result)
object.restart_quiz(restart)
# moves rika
if object.clicks in list(moves.keys()):
object.move = object.move_character(moves[object.clicks])
# shows the letters in the screen
if object.clicks in list(letters.keys()):
object.draw_letters(window, letters[object.clicks], sounds, WIDTH/2 + 60, HEIGHT/2)