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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
HTML
---------------------
div id="karma-main"
div id="action" --- main
div id="actionTop" --- top
div id="topLtSide" --- topLeftArea
img id="topLtBox" --- topLeftCard
div id="topLtPaper" --- topLeftPaper
div id="topMd" --- topMiddleArea
img id="plussign" --- plusImage
div id="topRtSide" --- topRightArea
img id="topRtBox" --- topRightCard
div id="topRtPaper" --- topRightPaper
div id="bottom" --- bottom
div id="bottomLt" --- bottomLeft
img class="bottomBox" --- bottomCards
div id="bottomLtPaper" class="bottomBox" --- bottomLeftPaper, bottomCard
div id="bottomMd" class="bottom" --- bottomMiddle, bottomAreas
img class="bottomBox" --- bottomCards
div id="bottomMdPaper" class="bottomBox" --- bottomMiddlePaper, bottomCards
div id="bottomRt" class="bottom" --- bottomRight, bottomAreas
img class="bottomBox" --- bottomCards
div id="bottomRtPaper" class="bottomBox" --- bottomRightPaper, bottomCards
div id="sidebar" --- side
div class="sidebarItem" --- sideItem
img id="timer"
div id="timerPaper" ---
div class="sidebarItem" --- sideItem
img id="scorebox" --- scoreBox
div id="scoreboxText" --- scoreBoxText
div class="sidebarItem"
div id="chimpPaper"
div id="buttons"
button id="start"
button id="stop"
button id="reset"
div id="overlayPaper"
JS
----------------------------
library.images
"ball", "balloon","banana", "chilli", "fish" , "flower"
"normalChimp", "happyChimp", "sadChimp", "correct", "incorrect", "trigger"
var imgNames = ["ball", "banana", "balloon","chilli", "fish", "flower"];
//game logic
var total=0, n0, n1, correct; ---- var total = 0, n0 = 0, n1 = 0,
correct = 0, level = 0, score = 0, playerCorrect = 0;
var level = 0, d=160; -- d should be 2 vars
----- DRAW_MAX_X =0, DRAW_MAX_Y = 0;
var choices=[], score = 0, speed = 12000; ---
var choices=[];
var timerSpeed = 12000;
var playerCorrect = 0, endTimerX = 80, startTimerY = 25,
endTimerY = 100, offsetTimerY = 5;
--------
END_TIMER_Y
START_TIMER_Y
var timerPaper, timerRect,
chimpPaper, normalChimp, sadChimp, happyChimp,
topLtBox, topRtBox, bottomLtBox, bottomMdBox, bottomRtBox;
--------------
var timerPaper, chimpPaper;
var timerRect;
var normalChimpImage, sadChimpImage, happyChimpImage;
var topLeftCard, topRightCard, bottomLeftCard, bottomMiddleCard,
bottomRightCard;
var buttons=[];
var stopTimer = false; -- isTimerActive
var chooseMe; --- dispatchCardChoice
var createBox = function (paperName) { ---- createCard
var set, paper; ---
var set;
var paper;
};
function game () { ---- setCards()
var imgId = imgNames[ level ] ; --- imgId
var card = function (box, n, d) { ---- setCard()
var pos = []; --- positions
var x, y, flag; ---- flag -- isOverlapping
var imgVarNames = {};
var prefix = box["prefix"]; --- varPrefix
var addButtons = function(){
var buttonNum = button.num; --- numButton
var mybutton = buttonNum ---- myButton
var removeButtons = function(){
var choose = function(buttonNum) { --- chooseCard
};
var writeScore = function (newscore){
};
var answer = function (correct, tooSlow) { -- computeScore
};
var start = function () { --- startGame
};
var stop = function () { --- stopGame
};
var reset = function () { --- resetGame
};
var resetTimer = function () {
};
var animateTimer = function () {
};
var animateChimp = function (answer) {
var timerChimp;
};
//end of Karma.main
});
//end of ready
});
|