-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
67 lines (54 loc) · 2.08 KB
/
Copy pathtrain.py
File metadata and controls
67 lines (54 loc) · 2.08 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
#Instructions
from playAudio import *
from playTone import *
from textCreator import *
from mouseClick import *
from feedback import *
def train(pygame, screen):
black = (0, 0, 0)
white = (255, 255, 255)
textCreate(pygame,screen,"Hello! In this game you will match the pace by clicking the mouse", white)
pygame.time.delay(5000)
clearScreen(screen)
textCreate(pygame,screen,"An X signals the start of a trial", white)
pygame.time.delay(4000)
clearScreen(screen)
textCreate(pygame,screen,"This tone signals the end of a trial", white)
playTone(16000, 500,2)
pygame.time.delay(4000)
clearScreen(screen)
textCreate(pygame,screen,"Synchronize with the tone when it begins by clicking the mouse", white)
pygame.time.delay(6000)
clearScreen(screen)
textCreate(pygame,screen,"Continue clicking the mouse at the same pace after the tone stops!", white)
pygame.time.delay(6000)
clearScreen(screen)
textCreate(pygame,screen,"The pace of the tone will either be 350ms or 550ms", white)
pygame.time.delay(6000)
clearScreen(screen)
textCreate(pygame,screen,"Let's practice!", white)
pygame.time.delay(3000)
clearScreen(screen)
textCreate(pygame, screen,"X", white)
pygame.time.delay(1000)
playAudio(pygame, 0)
play_time = mouseClick(pygame, 25)
playTone(16000, 500,2)
r = rate(play_time)
std_now = stdev(r)
mean_now = mean(r)
textCreate(pygame, screen, "Your average pace: %s, Your standard deviation: %s" %(mean_now, int(std_now)), white)
pygame.time.delay(4000)
textCreate(pygame,screen,"Let's practice at 550ms! Make sure to continue the pace!", white)
pygame.time.delay(5000)
clearScreen(screen)
textCreate(pygame, screen,"X", white)
pygame.time.delay(1000)
playAudio(pygame, 1)
play_time = mouseClick(pygame, 25)
playTone(16000, 500,2)
r = rate(play_time)
std_now = stdev(r)
mean_now = mean(r)
textCreate(pygame, screen, "Your average pace: %s, Your standard deviation: %s" %(mean_now, int(std_now)), white)
pygame.time.delay(4000)