|
From: Felix B. <fbe...@us...> - 2010-05-27 04:35:00
|
Module: performous
Branch: master
Commit: 1d59260c92007887853dc91643327c9f9745f08d
Author: Felix Bertram <fl...@be...>
Date: Wed May 26 21:33:19 2010 -0700
Kiddy mode
- removed flag from config
- increased timing window for kids
- now enabled via kick drum; will need to change in the future
---
data/schema.xml | 6 ------
game/guitargraph.cc | 20 +++++++++++++-------
game/guitargraph.hh | 1 -
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index ca2e8ce..1eea68e 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -88,12 +88,6 @@ to save the current settings to XML.
<long>Force joystick to some kind of instrument.</long>
</locale>
</entry>
- <entry name="game/kids_mode" type="bool" value="false">
- <locale name="C">
- <short>Use Kids rules for Easy dificulty</short>
- <long>Use Kids rules for Easy difficuty.</long>
- </locale>
- </entry>
<!-- Graphic preferences -->
<entry name="graphic/window_width" type="int" value="800" hidden="true">
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 7cdef5d..bab212f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -39,6 +39,11 @@ namespace {
const float drumfill_min_rate = 6.0; // The rate of hits per second required to complete a drum fill
double points(double error) {
+ // error points
+ // 150ms 15
+ // 100ms 30
+ // 50ms 45
+ // 30ms 50
double score = 0.0;
if (error < maxTolerance) score += 15;
if (error < 0.1) score += 15;
@@ -66,7 +71,6 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drums(drums),
m_use3d(config["graphic/3d_notes"].b()),
m_leftymode(false),
- m_kiddymode(config["game/kids_mode"].b()),
m_level(),
m_track_index(m_instrumentTracks.end()),
m_dfIt(m_drumfills.end()),
@@ -222,12 +226,11 @@ void GuitarGraph::engine() {
if (time < m_jointime) {
if (ev.type == input::Event::PICK || ev.type == input::Event::PRESS) {
if (!m_drums && ev.pressed[4]) nextTrack();
- if (ev.pressed[0 + m_drums]) {
- if (m_kiddymode) difficulty(DIFFICULTY_KIDS);
- else difficulty(DIFFICULTY_SUPAEASY); }
+ if (ev.pressed[0 + m_drums]) difficulty(DIFFICULTY_SUPAEASY);
else if (ev.pressed[1 + m_drums]) difficulty(DIFFICULTY_EASY);
else if (ev.pressed[2 + m_drums]) difficulty(DIFFICULTY_MEDIUM);
else if (ev.pressed[3 + m_drums]) difficulty(DIFFICULTY_AMAZING);
+ else if (ev.pressed[4 + m_drums]) difficulty(DIFFICULTY_KIDS);
difficulty_changed = true;
}
// Lefty-mode switch
@@ -366,7 +369,10 @@ void GuitarGraph::fail(double time, int fret) {
m_events.push_back(Event(time, 0, fret));
if (fret < 0) fret = std::rand();
m_audio.play(m_samples[unsigned(fret) % m_samples.size()], "audio/fail_volume");
- m_score -= 50;
+ // remove equivalent of 1 perfect hit for every note
+ // kids tend to play a lot of extra notes just for the fun of it.
+ // need to make sure they don't end up with a score of zero
+ m_score -= (m_level == DIFFICULTY_KIDS) ? points(0)/2.0 : points(0);
}
endStreak();
}
@@ -464,8 +470,8 @@ void GuitarGraph::drumHit(double time, int fret) {
// Record the hit event
m_events.push_back(Event(time, 1, fret, dur));
m_notes[dur] = m_events.size();
- // Scoring
- double score = points(tolerance);
+ // Scoring - be a little more generous for kids
+ double score = (m_level == DIFFICULTY_KIDS) ? points(tolerance/2.0) : points(tolerance);
m_chordIt->score += score;
m_score += score;
if (!m_drumfills.empty()) m_starmeter += score; // Only add starmeter if it's possible to activate GodMode
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index ccf9e9c..37db183 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -97,7 +97,6 @@ class GuitarGraph: public InstrumentGraph {
bool m_drums; /// are we using drums?
bool m_use3d; /// are we using 3d?
bool m_leftymode; /// switch guitar notes to right-to-left direction
- bool m_kiddymode; /// super-easy mode for kids
// Track stuff
enum Difficulty {
|