Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Apr 20, 2015
1 parent f6bb6a2 commit 487dbc0
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 16 deletions.
4 changes: 2 additions & 2 deletions conf.moon
Expand Up @@ -6,8 +6,8 @@ export GAME_CONFIG = {

quit: { "escape" }

one: { "1", joystick: {1, 3, 5} }
two: { "2", joystick: {2, 4, 6} }
one: { "1", "left", joystick: {1, 3, 5} }
two: { "2", "right", joystick: {2, 4, 6} }

up: "up"
down: "down"
Expand Down
22 changes: 16 additions & 6 deletions game.moon
Expand Up @@ -199,12 +199,15 @@ class TrackField extends Box
elseif pressed and not delta
@on_miss_note nil, true

-- note: we may have entered game over here from the miss note call above
@mark_missed_notes!

true

mark_missed_notes: =>
b, q = @track\get_beat!
return unless b

b += q

for note in @track.notes\each_note @get_bounds!
Expand All @@ -221,6 +224,8 @@ class TrackField extends Box
-- returns note, delta is ms
find_hit_note: (col) =>
b, q = @track\get_beat!
return unless b

local min_note, min_d

bq = b + q
Expand Down Expand Up @@ -279,6 +284,8 @@ class Game

Label ""
Label "press -1- to start"
Label ""
Label "use -1- and -2- to flick tongue"
}
}
@hit_list = VList {}
Expand All @@ -302,18 +309,21 @@ class Game
on_miss_note: (note, from_hit) =>
@visibility\decrement!

if @visibility.p <= 0
@field\on_game_over!

append_hit: (delta) =>
table.insert @hit_list.items, 1, Label "#{math.floor delta}"
@hit_list.items[11] = nil

draw: =>
@ui\draw!
-- debug notes
-- if notes = @track and @track.notes
-- notes\draw!

if notes = @track and @track.notes
notes\draw!

keypressed: (key) =>
if CONTROLLER\is_down "quit"
on_key: (key) =>
if @field and @track and CONTROLLER\is_down("quit")
@field\on_game_over!
return true

Expand All @@ -322,7 +332,7 @@ class Game
@entities\update dt
@particles\update dt

if CONTROLLER\downed "confirm"
if CONTROLLER\downed "confirm", "1"
unless @track
print "Queue track"
@track = Track @stage.module
Expand Down
4 changes: 2 additions & 2 deletions main.moon
@@ -1,7 +1,7 @@
require "lovekit.all"

if pcall(-> require"inotify")
require "lovekit.reloader"
-- if pcall(-> require"inotify")
-- require "lovekit.reloader"

{graphics: g} = love

Expand Down
2 changes: 1 addition & 1 deletion midi/1.moon
Expand Up @@ -144,6 +144,6 @@
"steady"

-- 36
"paradiddle"
"default"
}
}
Binary file added midi/1.ogg
Binary file not shown.
135 changes: 135 additions & 0 deletions midi/2.moon
@@ -0,0 +1,135 @@
{
bpm: 170
beats_per_measure: 8
measures: 38

notes: {
intro: {
rate: 1
"........"
}

default: {
rate: 1
"1.2.1.2."
}

default_outro: {
rate: 3
"1.......2.......1.......12121212"
}

hits: {
rate: 2
"111.2.111.1.2..."
}

hits_flip: {
rate: 2
"222.1.222.2.1..."
}

hits_outro: {
rate: 2
"222.1.222.2.1212"
}

fasterdiddle: {
rate: 2
"1211212212112122"
}

fasterdiddle2: {
rate: 2
"2112122121121221"
}

blah: {
rate: 2
"1.2.1121.2.112"
}

blah_flip: {
rate: 2
"2.1.2212.1.221"
}

roll: {
rate: 2
"1.2.11112.1.2222"
}

roll_flip: {
rate: 2
"2.1.22221.2.1111"
}

roll_outro: {
rate: 3
"1...2...1.1.1.1.2...1...21212121"
}

"intro"

-- 1 - 4
"hits"
"hits"
"hits_flip"
"hits_outro"

-- 5 - 8
"hits_flip"
"hits_outro"
"hits_flip"
"hits"

-- 9 - 12
"fasterdiddle"
"fasterdiddle2"
"fasterdiddle"
"fasterdiddle2"

-- 13
"hits_outro"

-- 14
"default"
"default_outro"

-- 16 - 19
"blah"
"blah"
"blah"
"blah"

-- 20 - 23
"blah_flip"
"blah"
"blah_flip"
"blah"

-- 24 - 27
"fasterdiddle"
"blah"
"fasterdiddle2"
"blah_flip"

-- 28 - 31
"roll"
"roll_flip"
"roll"
"roll_outro"


-- 32 - 35
"fasterdiddle"
"blah"
"fasterdiddle2"
"blah_flip"

-- 36
"hits"
"hits"

}
}
Binary file added midi/2.ogg
Binary file not shown.
Binary file modified midi/beat.ogg
Binary file not shown.
27 changes: 22 additions & 5 deletions ui.moon
Expand Up @@ -133,19 +133,20 @@ class StageSelect

stages: {
{
name: "1. tutorial"
name: "1. practice"
module: "beat"
desc: "let's go!"
}

{
name: "2. fake"
module: "beat"
name: "2. great ready"
module: "1"
desc: "kick it"
}

{
name: "2. stupid"
module: "beat"
name: "3. to the max"
module: "2"
desc: "& love &"
}
}
Expand All @@ -169,6 +170,22 @@ class StageSelect
@stage_items.padding = 10
list = VList @stage_items


list = VList {
Label "glasses protector 2000"
Label "ld 32 edition"
Label ""
Label "arrows move, enter select"
list

Label ""
with Label "leafo 2015"
.color = {255,255,255, 180}

with Label " dedicated 2 adit"
.color = {255,255,255, 180}
}

@ui = Bin 0, 0, @viewport.w, @viewport.h, list

move: (ds) =>
Expand Down

0 comments on commit 487dbc0

Please sign in to comment.