-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
231 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
-- data_1a.lua | ||
|
||
module(..., package.seeall); | ||
|
||
target_wpm = 15 | ||
actual_wpm = 0 | ||
nonsense_rep = 1 | ||
|
||
nonsense = {} | ||
nonsense.size = 8 | ||
nonsense[1] = "aaa jjj" | ||
nonsense[2] = "sss kkk" | ||
nonsense[3] = "ddd lll" | ||
nonsense[4] = "fff ;;;" | ||
nonsense[5] = "kkk sss" | ||
nonsense[6] = ";;; fff" | ||
nonsense[7] = "jjj aaa" | ||
nonsense[8] = "lll ddd" | ||
|
||
intro = {} | ||
intro.size = 8 | ||
intro[1] = "key: home\nHome row" | ||
intro[2] = intro[1] | ||
intro[3] = intro[1] | ||
intro[4] = intro[1] | ||
intro[5] = intro[1] | ||
intro[6] = intro[1] | ||
intro[7] = intro[1] | ||
intro[8] = intro[1] | ||
|
||
letter = {} | ||
letter.size = 8 | ||
letter[1] = "a" | ||
letter[2] = "s" | ||
letter[3] = "d" | ||
letter[4] = "f" | ||
letter[5] = "j" | ||
letter[6] = "k" | ||
letter[7] = "l" | ||
letter[8] = ";" | ||
|
||
short ={} | ||
short.size = 13 | ||
short[1] = "skd" | ||
short[2] = "add" | ||
short[3] = "all" | ||
short[4] = "as" | ||
short[5] = "kaf" | ||
short[6] = "sad" | ||
short[7] = "fad" | ||
short[8] = "ja;" | ||
short[9] = "ask;" | ||
short[10] = "all;" | ||
short[11] = "jal" | ||
short[12] = "lad" | ||
short[13] = "dad" | ||
|
||
long ={} | ||
long.size = 13 | ||
long[1] = "lads" | ||
long[2] = "daks" | ||
long[3] = "lakf" | ||
long[4] = "dlsk" | ||
long[5] = "ajds" | ||
long[6] = "jal;" | ||
long[7] = "salad" | ||
long[8] = "flask" | ||
long[9] = "lass" | ||
long[10] = "lads" | ||
long[11] = "jakl" | ||
long[12] = "falls" | ||
long[13] = "alas" | ||
|
||
-- The Flow | ||
-- nonsense x1 (first time x2 2nd time) (intro text) | ||
-- letter | ||
-- nonsense x1 (first time x2 2nd time) (no intro text) | ||
-- letter | ||
-- short x2 x8 (timed) | ||
-- actual wpm / target wpm 15 | ||
-- long x4 x4 (timed) | ||
-- actual wpm / target wpm 15 (repeat or continue) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- do_lesson.lua | ||
|
||
module(..., package.seeall); | ||
|
||
require "levels" | ||
require "nonsense" | ||
require "letters" | ||
|
||
local step = 0 | ||
|
||
function load(lesson_data) | ||
step = step + 1 | ||
love.graphics.setBackgroundColor(128,255,128) -- light green | ||
love.graphics.setColor(0,0,0) -- black | ||
|
||
if (step == 1) then nonsense.load(lesson_data,true,1) | ||
elseif (step == 2) then letters.load(lesson_data) | ||
elseif (step == 3) then nonsense.load(lesson_data,false,1) | ||
elseif (step == 4) then letters.load(lesson_data) | ||
else | ||
-- back to the levels selection | ||
step = 0 | ||
levels.load() | ||
end | ||
|
||
|
||
|
||
end | ||
|
||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
-- nonsense.lua | ||
|
||
module(..., package.seeall); | ||
|
||
require "levels" | ||
require "letters" | ||
|
||
local input = "" | ||
local line = 1 | ||
|
||
local text = {} | ||
local line1 = "" | ||
local index = 1 -- index into pattern array | ||
|
||
local pattern = {} | ||
local info = {} | ||
local show | ||
local lineSize | ||
local lesson_data_ = {} | ||
|
||
-- lesson_data: the data for this level | ||
-- showInfo: boolean, true if new key info should be displayed | ||
-- size: how many pattern entries should be put on a line (1 or 2) | ||
function load(lesson_data,showInfo,size) | ||
lesson_data_ = lesson_data | ||
pattern = lesson_data.nonsense | ||
|
||
info = lesson_data.intro | ||
show = showInfo | ||
lineSize = size | ||
|
||
love.graphics.setBackgroundColor(128,255,128) -- light green | ||
love.graphics.setColor(0,0,0) -- black | ||
love.draw = draw | ||
love.keypressed = keypressed | ||
input = "" | ||
line = 1 | ||
line1 = "" | ||
index = 1 | ||
end | ||
|
||
|
||
function draw() | ||
love.graphics.setFont(bigfont) | ||
if (show) then | ||
-- love.graphics.printf("Key: home \nHome row",10,50,800, 'left') | ||
love.graphics.printf(info[index],10,50,800, 'left') | ||
end | ||
love.graphics.printf(pattern[index], 350,150,740, 'left') | ||
if (line == 1) then | ||
love.graphics.printf(input .. "_", 350,250,740, 'left') | ||
else | ||
love.graphics.printf(line1, 350,250,740, 'left') | ||
love.graphics.printf(input .. "_", 350,300,740, 'left') | ||
end | ||
end | ||
|
||
function keypressed(key, unicode) | ||
if key == "escape" then | ||
levels.load() | ||
elseif key == "return" then | ||
love.audio.play(keysnd) | ||
if (input == pattern[index]) then | ||
if (line == 1) then | ||
line1 = input | ||
input = "" | ||
line = 2 | ||
else | ||
input = "" | ||
line1 = "" | ||
line = 1 | ||
index = index + 1 | ||
if (index > pattern.size) then | ||
--letters.load() | ||
do_lesson.load(lesson_data_) | ||
end | ||
end | ||
else | ||
input = "" | ||
end | ||
elseif (key == "backspace" or | ||
key == "rshift" or | ||
key == "lshift" | ||
) then | ||
-- do nothing | ||
else | ||
input = input .. key | ||
end | ||
end | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters