Permalink
Browse files

custom pixels beat, clean some printouts

  • Loading branch information...
1 parent cf97b6a commit 3c40d3656d2142381c832b292bb7c2c756c9f2ad @leafo committed Apr 20, 2015
Showing with 11 additions and 6 deletions.
  1. +0 −1 face.moon
  2. +7 −2 game.moon
  3. +1 −0 midi/2.moon
  4. +3 −3 notes.moon
View
@@ -22,7 +22,6 @@ class Tongue
@lerp = 0
move: (@target_x, @target_y) =>
- print "move", @target_x, @target_y
@seq = Sequence ->
tween @, 0.02, lerp: 1
tween @, 0.2, lerp: 0
View
@@ -43,6 +43,9 @@ class TrackField extends Box
@particles = DrawList!
@face = Face @track, 0, 0
+ @pixels_per_beat = @track.data.pixels_per_beat
+ print "setting pixels per beat to #{@pixels_per_beat}"
+
@main_seq = Sequence ->
wait_until -> @track.finished
import StatsSummary from require "ui"
@@ -226,7 +229,7 @@ class TrackField extends Box
b, q = @track\get_beat!
return unless b
- local min_note, min_d
+ local min_note, min_d, early
bq = b + q
for note in @track.notes\each_note b - 1, b + 1
@@ -239,10 +242,11 @@ class TrackField extends Box
if delta < min_d
min_note = note
min_d = delta
+ early = note.beat > bq
else
min_note = note
min_d = math.abs note.beat - bq
-
+ early = note.beat > bq
return unless min_note
@@ -252,6 +256,7 @@ class TrackField extends Box
@on_miss_note min_note, true
return nil, true
+ -- print early and "hit early" or "hit late"
min_note, delta
-- relative to viewport
View
@@ -2,6 +2,7 @@
bpm: 170
beats_per_measure: 8
measures: 38
+ pixels_per_beat: 70
notes: {
intro: {
View
@@ -10,8 +10,8 @@ class Note
draw: (@x, @y) =>
faded = @hit_delta or @missed
- if @hit_delta
- g.print "#{math.floor @hit_delta}", @x + @w, @y
+ -- if @hit_delta
+ -- g.print "#{math.floor @hit_delta}", @x + @w, @y
return if faded
@@ -91,7 +91,7 @@ class TrackNotes
beat_offset += @track.data.beats_per_measure
- @dump_notes!
+ -- @dump_notes!
dump_notes: =>
for note in *@all_notes

0 comments on commit 3c40d36

Please sign in to comment.