[Tux4kids-commits] r74 - in tuxmath/trunk: data/images
data/images/igloos data/images/penguins data/missions/lessons
docs src
dbruce at alioth.debian.org
dbruce at alioth.debian.org
Thu Mar 8 21:30:46 CET 2007
Author: dbruce
Date: 2007-01-31 23:18:29 +0000 (Wed, 31 Jan 2007)
New Revision: 74
Added:
tuxmath/trunk/data/images/igloos/
tuxmath/trunk/data/images/igloos/cloud.png
tuxmath/trunk/data/images/igloos/half.png
tuxmath/trunk/data/images/igloos/intact.png
tuxmath/trunk/data/images/igloos/melted1.png
tuxmath/trunk/data/images/igloos/melted2.png
tuxmath/trunk/data/images/igloos/melted3.png
tuxmath/trunk/data/images/igloos/rebuilding1.png
tuxmath/trunk/data/images/igloos/rebuilding2.png
tuxmath/trunk/data/images/igloos/snow1.png
tuxmath/trunk/data/images/igloos/snow2.png
tuxmath/trunk/data/images/igloos/snow3.png
tuxmath/trunk/data/images/igloos/steam1.png
tuxmath/trunk/data/images/igloos/steam2.png
tuxmath/trunk/data/images/igloos/steam3.png
tuxmath/trunk/data/images/igloos/steam4.png
tuxmath/trunk/data/images/igloos/steam5.png
tuxmath/trunk/data/images/penguins/
tuxmath/trunk/data/images/penguins/flapdown.png
tuxmath/trunk/data/images/penguins/flapup.png
tuxmath/trunk/data/images/penguins/grumpy.png
tuxmath/trunk/data/images/penguins/incoming.png
tuxmath/trunk/data/images/penguins/sitting-down.png
tuxmath/trunk/data/images/penguins/standing-up.png
tuxmath/trunk/data/images/penguins/walk-off1.png
tuxmath/trunk/data/images/penguins/walk-off2.png
tuxmath/trunk/data/images/penguins/walk-off3.png
tuxmath/trunk/data/images/penguins/walk-on1.png
tuxmath/trunk/data/images/penguins/walk-on2.png
tuxmath/trunk/data/images/penguins/walk-on3.png
tuxmath/trunk/data/missions/lessons/lesson10
tuxmath/trunk/data/missions/lessons/lesson11
tuxmath/trunk/data/missions/lessons/lesson12
tuxmath/trunk/data/missions/lessons/lesson13
tuxmath/trunk/data/missions/lessons/lesson14
tuxmath/trunk/data/missions/lessons/lesson15
tuxmath/trunk/data/missions/lessons/lesson16
tuxmath/trunk/data/missions/lessons/lesson17
tuxmath/trunk/data/missions/lessons/lesson18
tuxmath/trunk/data/missions/lessons/lesson19
tuxmath/trunk/data/missions/lessons/lesson20
tuxmath/trunk/data/missions/lessons/lesson21
tuxmath/trunk/data/missions/lessons/lesson22
tuxmath/trunk/data/missions/lessons/lesson23
tuxmath/trunk/data/missions/lessons/lesson24
tuxmath/trunk/data/missions/lessons/lesson25
tuxmath/trunk/data/missions/lessons/lesson26
Modified:
tuxmath/trunk/docs/changelog
tuxmath/trunk/src/credits.c
tuxmath/trunk/src/fileops.c
tuxmath/trunk/src/fileops.h
tuxmath/trunk/src/game.c
tuxmath/trunk/src/game.h
tuxmath/trunk/src/setup.c
tuxmath/trunk/src/titlescreen.c
tuxmath/trunk/src/titlescreen.h
tuxmath/trunk/src/tuxmath.h
Log:
Tux now defends penguins in igloos.
Added: tuxmath/trunk/data/images/igloos/cloud.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/cloud.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/half.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/half.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/intact.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/intact.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/melted1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/melted1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/melted2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/melted2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/melted3.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/melted3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/rebuilding1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/rebuilding1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/rebuilding2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/rebuilding2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/snow1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/snow1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/snow2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/snow2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/snow3.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/snow3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/steam1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/steam1.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/steam2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/steam2.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/steam3.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/steam3.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/steam4.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/steam4.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/igloos/steam5.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/igloos/steam5.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/flapdown.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/flapdown.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/flapup.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/flapup.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/grumpy.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/grumpy.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/incoming.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/incoming.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/sitting-down.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/sitting-down.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/standing-up.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/standing-up.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-off1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-off1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-off2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-off2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-off3.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-off3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-on1.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-on1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-on2.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-on2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/images/penguins/walk-on3.png
===================================================================
(Binary files differ)
Property changes on: tuxmath/trunk/data/images/penguins/walk-on3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tuxmath/trunk/data/missions/lessons/lesson10
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson10 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson10 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication: 0 to 3
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 3
+min_multiplicand = 0
+max_multiplicand = 3
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson11
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson11 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson11 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 2
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 2
+max_multiplier = 2
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson12
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson12 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson12 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 3
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 3
+max_multiplier = 3
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson13
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson13 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson13 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 4
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 4
+max_multiplier = 4
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson14
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson14 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson14 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 5
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 5
+max_multiplier = 5
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson15
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson15 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson15 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication: 0 to 5
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 5
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson16
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson16 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson16 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 6
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 6
+max_multiplier = 6
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson17
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson17 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson17 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 7
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 7
+max_multiplier = 7
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson18
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson18 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson18 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication 0 to 7
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 7
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 1
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson19
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson19 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson19 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 8
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 8
+max_multiplier = 8
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson20
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson20 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson20 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 9
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 9
+max_multiplier = 9
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson21
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson21 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson21 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 10
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 10
+max_multiplier = 10
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson22
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson22 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson22 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication: 0 to 10
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 10
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 1
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 1
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson23
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson23 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson23 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 11 and 12
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 11
+max_multiplier = 12
+min_multiplicand = 0
+max_multiplicand = 12
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 0
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson24
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson24 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson24 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication 0 to 12
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 12
+min_multiplicand = 0
+max_multiplicand = 12
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 1
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 0
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson25
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson25 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson25 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiples of 13, 14, and 15
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 13
+max_multiplier = 15
+min_multiplicand = 0
+max_multiplicand = 15
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 2
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 0
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Added: tuxmath/trunk/data/missions/lessons/lesson26
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson26 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/data/missions/lessons/lesson26 2007-01-31 23:18:29 UTC (rev 74)
@@ -0,0 +1,57 @@
+# Multiplication 0 to 15
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 0
+multiplication_allowed = 1
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 10
+min_multiplier = 0
+max_multiplier = 15
+min_multiplicand = 0
+max_multiplicand = 15
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 1
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 0
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 1
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 1
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+
Modified: tuxmath/trunk/docs/changelog
===================================================================
--- tuxmath/trunk/docs/changelog 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/docs/changelog 2007-01-31 23:18:29 UTC (rev 74)
@@ -1,5 +1,14 @@
changelog for "tuxmath"
+2007.Jan.31 (https://svn.tux4kids.net/tuxmath/ - revision 72)
+ Game/Graphics:
+ * New graphics in which Tux protects igloo-dwelling
+ penguins rather than cities. The older "city" mode still
+ works and is selectable via the config file.
+ * Restoration of lost igloo after each two waves.
+
+ Tim Holy <holy at wustl.edu>
+
2007.Jan.24 (https://svn.tux4kids.net/tuxmath/ - revision 69)
Options:
* More progress on new menu system, generally works
Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/credits.c 2007-01-31 23:18:29 UTC (rev 74)
@@ -56,6 +56,7 @@
"",
"-ADDITIONAL ART",
"BILL KENDRICK",
+ "KENDRA SWANSON & LINNEA HOLY",
"",
"-SOUND EFFECTS",
"TBA",
Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/fileops.c 2007-01-31 23:18:29 UTC (rev 74)
@@ -2110,6 +2110,34 @@
DATA_PREFIX "/images/tux/tux-sit.png",
DATA_PREFIX "/images/tux/tux-fist1.png",
DATA_PREFIX "/images/tux/tux-fist2.png",
+ DATA_PREFIX "/images/penguins/flapdown.png",
+ DATA_PREFIX "/images/penguins/flapup.png",
+ DATA_PREFIX "/images/penguins/incoming.png",
+ DATA_PREFIX "/images/penguins/grumpy.png",
+ DATA_PREFIX "/images/penguins/standing-up.png",
+ DATA_PREFIX "/images/penguins/sitting-down.png",
+ DATA_PREFIX "/images/penguins/walk-on1.png",
+ DATA_PREFIX "/images/penguins/walk-on2.png",
+ DATA_PREFIX "/images/penguins/walk-on3.png",
+ DATA_PREFIX "/images/penguins/walk-off1.png",
+ DATA_PREFIX "/images/penguins/walk-off2.png",
+ DATA_PREFIX "/images/penguins/walk-off3.png",
+ DATA_PREFIX "/images/igloos/melted3.png",
+ DATA_PREFIX "/images/igloos/melted2.png",
+ DATA_PREFIX "/images/igloos/melted1.png",
+ DATA_PREFIX "/images/igloos/half.png",
+ DATA_PREFIX "/images/igloos/intact.png",
+ DATA_PREFIX "/images/igloos/rebuilding1.png",
+ DATA_PREFIX "/images/igloos/rebuilding2.png",
+ DATA_PREFIX "/images/igloos/steam1.png",
+ DATA_PREFIX "/images/igloos/steam2.png",
+ DATA_PREFIX "/images/igloos/steam3.png",
+ DATA_PREFIX "/images/igloos/steam4.png",
+ DATA_PREFIX "/images/igloos/steam5.png",
+ DATA_PREFIX "/images/igloos/cloud.png",
+ DATA_PREFIX "/images/igloos/snow1.png",
+ DATA_PREFIX "/images/igloos/snow2.png",
+ DATA_PREFIX "/images/igloos/snow3.png",
DATA_PREFIX "/images/status/wave.png",
DATA_PREFIX "/images/status/score.png",
DATA_PREFIX "/images/status/numbers.png",
Modified: tuxmath/trunk/src/fileops.h
===================================================================
--- tuxmath/trunk/src/fileops.h 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/fileops.h 2007-01-31 23:18:29 UTC (rev 74)
@@ -130,6 +130,34 @@
IMG_TUX_SIT,
IMG_TUX_FIST1,
IMG_TUX_FIST2,
+ IMG_PENGUIN_FLAPDOWN,
+ IMG_PENGUIN_FLAPUP,
+ IMG_PENGUIN_INCOMING,
+ IMG_PENGUIN_GRUMPY,
+ IMG_PENGUIN_STANDING_UP,
+ IMG_PENGUIN_SITTING_DOWN,
+ IMG_PENGUIN_WALK_ON1,
+ IMG_PENGUIN_WALK_ON2,
+ IMG_PENGUIN_WALK_ON3,
+ IMG_PENGUIN_WALK_OFF1,
+ IMG_PENGUIN_WALK_OFF2,
+ IMG_PENGUIN_WALK_OFF3,
+ IMG_IGLOO_MELTED3,
+ IMG_IGLOO_MELTED2,
+ IMG_IGLOO_MELTED1,
+ IMG_IGLOO_HALF,
+ IMG_IGLOO_INTACT,
+ IMG_IGLOO_REBUILDING1,
+ IMG_IGLOO_REBUILDING2,
+ IMG_STEAM1,
+ IMG_STEAM2,
+ IMG_STEAM3,
+ IMG_STEAM4,
+ IMG_STEAM5,
+ IMG_CLOUD,
+ IMG_SNOW1,
+ IMG_SNOW2,
+ IMG_SNOW3,
IMG_WAVE,
IMG_SCORE,
IMG_NUMBERS,
Modified: tuxmath/trunk/src/game.c
===================================================================
--- tuxmath/trunk/src/game.c 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/game.c 2007-01-31 23:18:29 UTC (rev 74)
@@ -36,10 +36,25 @@
#define CITY_EXPL_START 3 * 5 /* Must be mult. of 5 (number of expl frames) */
#define ANIM_FRAME_START 4 * 2 /* Must be mult. of 2 (number of tux frames) */
-#define GAMEOVER_COUNTER_START 750
+#define GAMEOVER_COUNTER_START 40
#define LEVEL_START_WAIT_START 20
#define LASER_START 5
+#define FLAPPING_START 12
+#define FLAPPING_INTERVAL 500
+#define STEAM_START 15
+#define IGLOO_SWITCH_START 8
+#define STANDING_COUNTER_START 8
+#define EVAPORATING_COUNTER_START 100
+#define PENGUIN_WALK_SPEED 3
+#define SNOWFLAKE_SPEED 3
+#define SNOWFLAKE_SEPARATION 3
+
+#define Opts_ExtraLifeInterval() 2
+
+const int SND_IGLOO_SIZZLE = SND_SIZZLE;
+const int IMG_CITY_NONE = 0;
+
char operchars[NUM_OPERS] = {
"+-*/"
};
@@ -75,7 +90,7 @@
/* Local (to game.c) 'globals': */
-//static int gameover;
+static int gameover_counter;
static int game_status;
static int SDL_quit_received;
static int escape_received;
@@ -100,6 +115,8 @@
static int doing_answer;
static int level_start_wait;
static int last_bkgd;
+static int igloo_vertical_offset;
+static int extra_life_counter;
/* Feedback-related variables */
static int city_expl_height;
@@ -111,6 +128,9 @@
static int digits[3];
static comet_type comets[MAX_MAX_COMETS];
static city_type cities[NUM_CITIES];
+static penguin_type penguins[NUM_CITIES];
+static steam_type steam[NUM_CITIES];
+static cloud_type cloud;
static laser_type laser;
static SDL_Surface* bkgd;
@@ -123,7 +143,11 @@
static void game_handle_tux(void);
static void game_handle_comets(void);
static void game_handle_cities(void);
+static void game_handle_penguins(void);
+static void game_handle_steam(void);
+static void game_handle_extra_life(void);
static void game_draw(void);
+static int check_extra_life(void);
static int check_exit_conditions(void);
static void draw_numbers(char* str, int x, int y);
@@ -144,6 +168,7 @@
#ifdef TUXMATH_DEBUG
static void print_exit_conditions(void);
+static void print_status(void);
#endif
/* --- MAIN GAME FUNCTION!!! --- */
@@ -183,7 +208,10 @@
game_handle_tux();
game_handle_comets();
game_handle_cities();
+ game_handle_penguins();
+ game_handle_steam();
game_handle_demo();
+ game_handle_extra_life();
game_draw();
/* figure out if we should leave loop: */
game_status = check_exit_conditions();
@@ -406,13 +434,14 @@
int game_initialize(void)
{
- int i;
+ int i,img;
/* Clear window: */
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
SDL_Flip(screen);
game_status = GAME_IN_PROGRESS;
+ gameover_counter = -1;
SDL_quit_received = 0;
escape_received = 0;
@@ -456,30 +485,51 @@
/* (Create and position cities) */
+ if (Opts_UseIgloos())
+ img = IMG_IGLOO_INTACT;
+ else
+ img = IMG_CITY_BLUE;
for (i = 0; i < NUM_CITIES; i++)
{
- cities[i].alive = 1;
- cities[i].expl = 0;
- cities[i].shields = 1;
+ cities[i].hits_left = 2;
+ cities[i].status = CITY_PRESENT;
+ cities[i].counter = 0;
+ cities[i].threatened = 0;
+ cities[i].layer = 0;
/* Left vs. Right - makes room for Tux and the console */
if (i < NUM_CITIES / 2)
{
cities[i].x = (((screen->w / (NUM_CITIES + 1)) * i) +
- ((images[IMG_CITY_BLUE] -> w) / 2));
+ ((images[img] -> w) / 2));
}
else
{
cities[i].x = (screen->w -
((((screen->w / (NUM_CITIES + 1)) *
(i - (NUM_CITIES / 2)) +
- ((images[IMG_CITY_BLUE] -> w) / 2)))));
+ ((images[img] -> w) / 2)))));
}
}
num_cities_alive = NUM_CITIES;
num_comets_alive = 0;
+ igloo_vertical_offset = images[IMG_CITY_BLUE]->h - images[IMG_IGLOO_INTACT]->h;
+
+ /* Create and position the penguins and steam */
+ for (i = 0; i < NUM_CITIES; i++) {
+ penguins[i].status = PENGUIN_HAPPY;
+ penguins[i].counter = 0;
+ penguins[i].x = cities[i].x;
+ penguins[i].layer = 0;
+ steam[i].status = STEAM_OFF;
+ steam[i].layer = 0;
+ }
+
+ extra_life_counter = Opts_ExtraLifeInterval();
+ cloud.status = EXTRA_LIFE_OFF;
+
/* (Clear laser) */
laser.alive = 0;
@@ -771,19 +821,30 @@
void game_handle_comets(void)
{
- int i;
- /* Handle comets: */
+ /* Handle comets. Since the comets also are the things that trigger
+ changes in the cities, we set some flags in them, too. */
+ int i,this_city;
num_comets_alive = 0;
+ /* Clear the threatened flag on each city */
+ for (i = 0; i < NUM_CITIES; i++)
+ cities[i].threatened = 0;
+
for (i = 0; i < MAX_COMETS; i++)
{
if (comets[i].alive)
{
num_comets_alive++;
+ this_city = comets[i].city;
+
/* Update comet position */
comets[i].x = comets[i].x + 0; /* no lateral motion for now! */
comets[i].y = comets[i].y + (speed);
+ /* Does it threaten a city? */
+ if (comets[i].y > 3*screen->h / 4)
+ cities[this_city].threatened = 1;
+
/* Did it hit a city? */
if (comets[i].y >= city_expl_height &&
comets[i].expl < COMET_EXPL_END)
@@ -791,22 +852,10 @@
/* Tell MathCards about it - question not answered correctly: */
MC_NotAnsweredCorrectly(&(comets[i].flashcard));
- /* Disable shields or destroy city: */
- if (cities[comets[i].city].shields)
- {
- cities[comets[i].city].shields = 0;
- playsound(SND_SHIELDSDOWN);
- }
- else
- {
- cities[comets[i].city].expl = CITY_EXPL_START;
- playsound(SND_EXPLOSION);
- }
-
/* Record data for feedback */
- /* Do this only for cities that are threatened; dead cities */
+ /* Do this only for cities that are alive; dead cities */
/* might not get much protection from the player */
- if (Opts_UseFeedback() && cities[comets[i].city].alive) {
+ if (Opts_UseFeedback() && cities[this_city].hits_left) {
comet_feedback_number++;
comet_feedback_height += 1.0 + Opts_CityExplHandicap();
@@ -816,6 +865,29 @@
#endif
}
+ /* Disable shields/destroy city/create steam cloud: */
+ if (cities[this_city].hits_left)
+ {
+ cities[this_city].status = CITY_EXPLODING;
+ if (Opts_UseIgloos()) {
+ playsound(SND_IGLOO_SIZZLE);
+ cities[this_city].counter = IGLOO_SWITCH_START;
+ steam[this_city].status = STEAM_ON;
+ steam[this_city].counter = STEAM_START;
+ }
+ else {
+ if (cities[comets[i].city].hits_left == 2) {
+ playsound(SND_SHIELDSDOWN);
+ cities[this_city].counter = 1; /* Will act immediately */
+ }
+ else {
+ playsound(SND_EXPLOSION);
+ cities[this_city].counter = CITY_EXPL_START;
+ }
+ }
+ cities[this_city].hits_left--;
+ }
+
/* If slow_after_wrong selected, set flag to go back to starting speed and */
/* number of attacking comets: */
if (Opts_SlowAfterWrong())
@@ -860,9 +932,11 @@
{
if (num_comets_alive == 0)
{
- /* Time for the next wave! */
+ if (!check_extra_life()) {
+ /* Time for the next wave! */
wave++;
reset_level();
+ }
}
}
}
@@ -872,31 +946,307 @@
void game_handle_cities(void)
{
+ /* Update the status of the cities. These also determine the changes
+ in the penguins. */
int i;
num_cities_alive = 0;
for (i = 0; i < NUM_CITIES; i++)
{
- if (cities[i].alive)
+ /* Note: when status is CITY_REBUILDING, status and image
+ selection is handled by the extra_life code */
+ if (cities[i].status == CITY_REBUILDING)
+ continue;
+ if (cities[i].hits_left)
+ num_cities_alive++;
+ /* Handle counter for animated explosion: */
+ if (cities[i].status == CITY_EXPLODING)
{
- num_cities_alive++;
- /* Handle animated explosion: */
- if (cities[i].expl)
- {
- cities[i].expl--;
- if (cities[i].expl == 0)
- cities[i].alive = 0;
+ cities[i].counter--;
+ if (cities[i].counter == 0) {
+ if (cities[i].hits_left)
+ cities[i].status = CITY_PRESENT;
+ else {
+ if (Opts_UseIgloos()) {
+ cities[i].status = CITY_EVAPORATING;
+ cities[i].counter = EVAPORATING_COUNTER_START;
+ cities[i].img = IMG_IGLOO_MELTED1;
+ } else {
+ cities[i].status = CITY_GONE;
+ cities[i].img = IMG_CITY_NONE;
+ }
+ }
}
}
+ /* Choose the correct city/igloo image */
+ if (Opts_UseIgloos()) {
+ if (cities[i].status == CITY_EVAPORATING) {
+ /* Handle the evaporation animation */
+ cities[i].layer = 0; /* these have to be drawn below the penguin */
+ cities[i].counter--;
+ if (cities[i].counter == 0) {
+ cities[i].img--;
+ if (cities[i].img < IMG_IGLOO_MELTED3) {
+ cities[i].img = IMG_CITY_NONE;
+ cities[i].status = CITY_GONE;
+ }
+ else
+ cities[i].counter = EVAPORATING_COUNTER_START;
+ }
+ } else {
+ if (cities[i].status != CITY_GONE) {
+ cities[i].layer = 1; /* these have to be drawn above the penguin */
+ cities[i].img = IMG_IGLOO_MELTED1 + cities[i].hits_left;
+ /* If we're in the middle of an "explosion," don't switch to the
+ new igloo. Note the steam may have a different counter than
+ the igloo on this matter; the switch is designed to occur
+ halfway through the steam cloud. */
+ if (cities[i].status == CITY_EXPLODING)
+ cities[i].img++;
+ }
+ }
+ }
+ else {
+ /* We're using the original "city" graphics */
+ cities[i].layer = 0; /* No layering needed */
+ if (cities[i].hits_left)
+ cities[i].img = IMG_CITY_BLUE;
+ else if (cities[i].status == CITY_EXPLODING)
+ cities[i].img = (IMG_CITY_BLUE_EXPL5 - (cities[i].counter / (CITY_EXPL_START / 5)));
+ else
+ cities[i].img = IMG_CITY_BLUE_DEAD;
+
+ /* Change image to appropriate color: */
+ cities[i].img = cities[i].img + ((wave % MAX_CITY_COLORS) *
+ (IMG_CITY_GREEN - IMG_CITY_BLUE));
+
+ }
}
}
+void game_handle_penguins(void)
+{
+ int i,direction,walk_counter;
+
+ if (!Opts_UseIgloos())
+ return;
+ for (i = 0; i < NUM_CITIES; i++) {
+ penguins[i].layer = 0;
+ if (cities[i].status == CITY_EVAPORATING)
+ penguins[i].layer = 1; /* will go higher in certain cases */
+ /* Handle interaction with comets & city status (ducking) */
+ if (cities[i].threatened && penguins[i].status < PENGUIN_WALKING_OFF
+ && penguins[i].status != PENGUIN_OFFSCREEN)
+ penguins[i].status = PENGUIN_DUCKING;
+ else if (!cities[i].threatened && penguins[i].status == PENGUIN_DUCKING) {
+ if (cities[i].hits_left == 2)
+ penguins[i].status = PENGUIN_HAPPY;
+ else
+ penguins[i].status = PENGUIN_GRUMPY;
+ }
+ switch (penguins[i].status) {
+ case PENGUIN_HAPPY:
+ penguins[i].img = IMG_PENGUIN_FLAPDOWN;
+ if (rand() % FLAPPING_INTERVAL == 0) {
+ penguins[i].status = PENGUIN_FLAPPING;
+ penguins[i].counter = FLAPPING_START;
+ }
+ break;
+ case PENGUIN_FLAPPING:
+ if (penguins[i].counter % 4 >= 2)
+ penguins[i].img = IMG_PENGUIN_FLAPUP;
+ else
+ penguins[i].img = IMG_PENGUIN_FLAPDOWN;
+ penguins[i].counter--;
+ if (penguins[i].counter == 0)
+ penguins[i].status = PENGUIN_HAPPY;
+ break;
+ case PENGUIN_DUCKING:
+ penguins[i].img = IMG_PENGUIN_INCOMING;
+ break;
+ case PENGUIN_GRUMPY:
+ penguins[i].img = IMG_PENGUIN_GRUMPY;
+ /* add "worried" animation here? */
+ break;
+ case PENGUIN_STANDING_UP:
+ penguins[i].img = IMG_PENGUIN_STANDING_UP;
+ penguins[i].counter--;
+ if (penguins[i].counter == 0)
+ penguins[i].status = PENGUIN_WALKING_OFF;
+ break;
+ case PENGUIN_SITTING_DOWN:
+ penguins[i].img = IMG_PENGUIN_SITTING_DOWN;
+ penguins[i].counter--;
+ if (penguins[i].counter == 0) {
+ penguins[i].status = PENGUIN_FLAPPING;
+ penguins[i].counter = FLAPPING_START;
+ }
+ break;
+ case PENGUIN_WALKING_ON:
+ walk_counter = (penguins[i].counter % 8)/2;
+ if (walk_counter == 3)
+ walk_counter = 1;
+ penguins[i].img = IMG_PENGUIN_WALK_ON1 + walk_counter;
+ penguins[i].counter++;
+ direction = 2*(i < NUM_CITIES/2)-1; /* +1 for walk right, -1 for left */
+ penguins[i].x += direction*PENGUIN_WALK_SPEED;
+ if (direction*penguins[i].x >= direction*cities[i].x) {
+ penguins[i].status = PENGUIN_SITTING_DOWN;
+ penguins[i].counter = STANDING_COUNTER_START;
+ penguins[i].x = cities[i].x;
+ }
+ penguins[i].layer = 3; /* Stand in front of steam */
+ break;
+ case PENGUIN_WALKING_OFF:
+ walk_counter = (penguins[i].counter % 8)/2;
+ if (walk_counter == 3)
+ walk_counter = 1;
+ penguins[i].img = IMG_PENGUIN_WALK_OFF1 + walk_counter;
+ penguins[i].counter++;
+ direction = 1-2*(i < NUM_CITIES/2);
+ penguins[i].x += direction*PENGUIN_WALK_SPEED;
+ if (direction < 0) {
+ if (penguins[i].x + images[IMG_PENGUIN_WALK_OFF1]->w/2 < 0)
+ penguins[i].status = PENGUIN_OFFSCREEN;
+ } else {
+ if (penguins[i].x - images[IMG_PENGUIN_WALK_OFF1]->w/2 > screen->w)
+ penguins[i].status = PENGUIN_OFFSCREEN;
+ }
+ penguins[i].layer = 3;
+ break;
+ case PENGUIN_OFFSCREEN:
+ penguins[i].img = -1;
+ break;
+ }
+ }
+}
+
+void game_handle_steam(void)
+{
+ int i;
+
+ if (!Opts_UseIgloos())
+ return;
+ for (i = 0; i < NUM_CITIES; i++) {
+ if (steam[i].counter) {
+ steam[i].counter--;
+ if (!steam[i].counter) {
+ steam[i].status = STEAM_OFF;
+ /* The penguin was ducking, now we can stop */
+ if (cities[i].hits_left)
+ penguins[i].status = PENGUIN_GRUMPY;
+ else {
+ penguins[i].status = PENGUIN_STANDING_UP;
+ penguins[i].counter = STANDING_COUNTER_START;
+ }
+ }
+ }
+ if (steam[i].status == STEAM_OFF)
+ steam[i].img = -1;
+ else {
+ steam[i].img = IMG_STEAM5 - steam[i].counter/3;
+ steam[i].layer = 2;
+ }
+ }
+}
+
+int check_extra_life(void)
+{
+ /* This is called at the end of a wave. Returns 1 if we're in the
+ middle of handling an extra life, otherwise 0 */
+ int i,snow_width;
+
+ if (!Opts_ExtraLifeInterval())
+ return 0;
+ if (cloud.status == EXTRA_LIFE_ON)
+ return 1;
+#ifdef TUXMATH_DEBUG
+ print_status();
+#endif
+ if (extra_life_counter)
+ extra_life_counter--;
+ if (extra_life_counter == 0 &&
+ num_cities_alive < NUM_CITIES) {
+ /* Begin the extra life sequence */
+ extra_life_counter = Opts_ExtraLifeInterval()+1; /* compensates for next -- */
+ cloud.status = EXTRA_LIFE_ON;
+ cloud.y = screen->h/3;
+ i = 0;
+ while (cities[i].hits_left)
+ i++;
+ cloud.city = i;
+ if (cloud.city < NUM_CITIES/2)
+ cloud.x = -images[IMG_CLOUD]->w/2;
+ else
+ cloud.x = screen->w + images[IMG_CLOUD]->w/2;
+ penguins[cloud.city].status = PENGUIN_WALKING_ON;
+ /* initialize the snowflakes */
+ snow_width = images[IMG_CLOUD]->w - images[IMG_SNOW1]->w;
+ for (i = 0; i < NUM_SNOWFLAKES; i++) {
+ cloud.snowflake_y[i] = cloud.y - i*SNOWFLAKE_SEPARATION;
+ cloud.snowflake_x[i] = - snow_width/2 + (rand() % snow_width);
+ cloud.snowflake_size[i] = rand() % 3;
+ }
+#ifdef TUXMATH_DEBUG
+ print_status();
+#endif
+ return 1;
+ } else
+ return 0;
+}
+
+void game_handle_extra_life(void)
+{
+ int i,igloo_top,num_below,status,direction;
+ Uint8 cloud_transparency;
+
+ if (cloud.status == EXTRA_LIFE_ON) {
+ direction = 2*(cloud.city < NUM_CITIES/2) - 1;
+ if (direction*cloud.x < direction*cities[cloud.city].x) {
+ cloud.x += direction*PENGUIN_WALK_SPEED;
+ SDL_SetAlpha(images[IMG_CLOUD],SDL_SRCALPHA | SDL_RLEACCEL,
+ SDL_ALPHA_OPAQUE);
+ }
+ else {
+ cities[cloud.city].status = CITY_REBUILDING;
+ for (i = 0, num_below = 0; i < NUM_SNOWFLAKES; i++) {
+ cloud.snowflake_y[i] += SNOWFLAKE_SPEED;
+ if (cloud.snowflake_y[i] > cloud.y)
+ num_below++;
+ }
+ cloud_transparency = (Uint8) ((float) (NUM_SNOWFLAKES-num_below)/NUM_SNOWFLAKES
+ * (float) SDL_ALPHA_OPAQUE);
+ status = SDL_SetAlpha(images[IMG_CLOUD],SDL_SRCALPHA,cloud_transparency);
+ igloo_top = screen->h - igloo_vertical_offset
+ - images[IMG_IGLOO_INTACT]->h;
+ if (cloud.snowflake_y[NUM_SNOWFLAKES-1] > igloo_top) {
+ cities[cloud.city].hits_left = 2;
+ cities[cloud.city].img = IMG_IGLOO_INTACT;
+ }
+ else if (cloud.snowflake_y[2*NUM_SNOWFLAKES/3] > igloo_top)
+ cities[cloud.city].img = IMG_IGLOO_REBUILDING2;
+ else if (cloud.snowflake_y[NUM_SNOWFLAKES/3] > igloo_top)
+ cities[cloud.city].img = IMG_IGLOO_REBUILDING1;
+ if (cloud.snowflake_y[NUM_SNOWFLAKES/3] > igloo_top) {
+ penguins[cloud.city].layer = 0;
+ cities[cloud.city].layer = 1;
+ }
+ if (cloud.snowflake_y[NUM_SNOWFLAKES-1] > screen->h - igloo_vertical_offset) {
+ /* exit rebuilding when last snowflake at igloo bottom */
+ cloud.status = EXTRA_LIFE_OFF;
+ cities[cloud.city].status = CITY_PRESENT;
+ }
+ }
+ }
+}
+
/* FIXME consider splitting this into smaller functions e.g. draw_comets(), etc. */
void game_draw(void)
{
- int i,j, img;
+ int i,j, img, current_layer, max_layer;
SDL_Rect src, dest;
+ SDL_Surface *this_image;
char str[64];
char* comet_str;
@@ -967,49 +1317,120 @@
sprintf(str, "%.6d", score);
draw_numbers(str, screen->w - ((images[IMG_NUMBERS]->w / 10) * 6), 0);
- /* Draw cities: */
- for (i = 0; i < NUM_CITIES; i++)
- {
- /* Decide which image to display: */
- if (cities[i].alive)
- {
- if (cities[i].expl == 0)
- img = IMG_CITY_BLUE;
- else
- img = (IMG_CITY_BLUE_EXPL5 - (cities[i].expl / (CITY_EXPL_START / 5)));
+ /* Draw cities/igloos and (if applicable) penguins: */
+ if (Opts_UseIgloos()) {
+ /* We have to draw respecting layering */
+ current_layer = 0;
+ max_layer = 0;
+ do {
+ for (i = 0; i < NUM_CITIES; i++) {
+ if (cities[i].status != CITY_GONE && cities[i].layer > max_layer)
+ max_layer = cities[i].layer;
+ if (penguins[i].status != PENGUIN_OFFSCREEN && penguins[i].layer > max_layer)
+ max_layer = penguins[i].layer;
+ if (steam[i].status == STEAM_ON && steam[i].layer > max_layer)
+ max_layer = steam[i].layer;
+ if (cities[i].layer == current_layer &&
+ cities[i].img != IMG_CITY_NONE) {
+ this_image = images[cities[i].img];
+ dest.x = cities[i].x - (this_image->w / 2);
+ dest.y = (screen->h) - (this_image->h) - igloo_vertical_offset;
+ if (cities[i].img == IMG_IGLOO_MELTED3 ||
+ cities[i].img == IMG_IGLOO_MELTED2)
+ dest.y -= (images[IMG_IGLOO_MELTED1]->h - this_image->h)/2;
+ dest.w = (this_image->w);
+ dest.h = (this_image->h);
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
+ }
+ if (penguins[i].layer == current_layer &&
+ penguins[i].status != PENGUIN_OFFSCREEN) {
+ this_image = images[penguins[i].img];
+ if (penguins[i].status == PENGUIN_WALKING_OFF ||
+ penguins[i].status == PENGUIN_WALKING_ON) {
+ /* With walking penguins, we have to use flipped images
+ when it's walking left. The other issue is that the
+ images are of different widths, so aligning on the
+ center produces weird forward-backward walking. The
+ reliable way is the align them all on the tip of the
+ beak (the right border of the unflipped image) */
+ dest.x = penguins[i].x - (this_image->w / 2);
+ dest.y = (screen->h) - (this_image->h);
+ if ((i<NUM_CITIES/2 && penguins[i].status==PENGUIN_WALKING_OFF) ||
+ (i>=NUM_CITIES/2 && penguins[i].status==PENGUIN_WALKING_ON)) {
+ /* walking left */
+ this_image = flipped_images[flipped_img_lookup[penguins[i].img]];
+ dest.x = penguins[i].x - images[IMG_PENGUIN_WALK_OFF2]->w/2;
+ } else
+ dest.x = penguins[i].x - this_image->w
+ + images[IMG_PENGUIN_WALK_OFF2]->w/2; /* walking right */
+ }
+ else {
+ dest.x = penguins[i].x - (this_image->w / 2);
+ dest.y = (screen->h) - (5*(this_image->h))/4 - igloo_vertical_offset;
+ }
+ dest.w = (this_image->w);
+ dest.h = (this_image->h);
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
+ }
+ if (steam[i].layer == current_layer &&
+ steam[i].status == STEAM_ON) {
+ this_image = images[steam[i].img];
+ dest.x = cities[i].x - (this_image->w / 2);
+ dest.y = (screen->h) - this_image->h - ((4 * images[IMG_IGLOO_INTACT]->h) / 7);
+ dest.w = (this_image->w);
+ dest.h = (this_image->h);
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
+ }
+ }
+ current_layer++;
+ } while (current_layer <= max_layer);
+ if (cloud.status == EXTRA_LIFE_ON) {
+ /* Render cloud & snowflakes */
+ for (i = 0; i < NUM_SNOWFLAKES; i++) {
+ if (cloud.snowflake_y[i] > cloud.y &&
+ cloud.snowflake_y[i] < screen->h - igloo_vertical_offset) {
+ this_image = images[IMG_SNOW1+cloud.snowflake_size[i]];
+ dest.x = cloud.snowflake_x[i] - this_image->w/2 + cloud.x;
+ dest.y = cloud.snowflake_y[i] - this_image->h/2;
+ dest.w = this_image->w;
+ dest.h = this_image->h;
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
+ }
+ }
+ this_image = images[IMG_CLOUD];
+ dest.x = cloud.x - this_image->w/2;
+ dest.y = cloud.y - this_image->h/2;
+ dest.w = this_image->w;
+ dest.h = this_image->h;
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
}
- else
- {
- img = IMG_CITY_BLUE_DEAD;
- }
- /* Change image to appropriate color: */
- img = img + ((wave % MAX_CITY_COLORS) *
- (IMG_CITY_GREEN - IMG_CITY_BLUE));
-
- /* Draw it! */
- dest.x = cities[i].x - (images[img]->w / 2);
- dest.y = (screen->h) - (images[img]->h);
- dest.w = (images[img]->w);
- dest.h = (images[img]->h);
-
- SDL_BlitSurface(images[img], NULL, screen, &dest);
+ }
+ else {
+ /* We're drawing original city graphics, for which there are no
+ layering issues, but has special handling for the shields */
+ for (i = 0; i < NUM_CITIES; i++) {
+ this_image = images[cities[i].img];
+ dest.x = cities[i].x - (this_image->w / 2);
+ dest.y = (screen->h) - (this_image->h);
+ dest.w = (this_image->w);
+ dest.h = (this_image->h);
+ SDL_BlitSurface(this_image, NULL, screen, &dest);
- /* Draw sheilds: */
- if (cities[i].shields)
- {
- for (j = (frame % 3); j < images[IMG_SHIELDS]->h; j = j + 3)
- {
- src.x = 0;
- src.y = j;
- src.w = images[IMG_SHIELDS]->w;
- src.h = 1;
+ /* Draw sheilds: */
+ if (cities[i].hits_left > 1) {
+ for (j = (frame % 3); j < images[IMG_SHIELDS]->h; j = j + 3) {
+ src.x = 0;
+ src.y = j;
+ src.w = images[IMG_SHIELDS]->w;
+ src.h = 1;
- dest.x = cities[i].x - (images[IMG_SHIELDS]->w / 2);
- dest.y = (screen->h) - (images[IMG_SHIELDS]->h) + j;
- dest.w = src.w;
- dest.h = src.h;
+ dest.x = cities[i].x - (images[IMG_SHIELDS]->w / 2);
+ dest.y = (screen->h) - (images[IMG_SHIELDS]->h) + j;
+ dest.w = src.w;
+ dest.h = src.h;
- SDL_BlitSurface(images[IMG_SHIELDS], &src, screen, &dest);
+ SDL_BlitSurface(images[IMG_SHIELDS], &src, screen, &dest);
+ }
}
}
}
@@ -1112,7 +1533,11 @@
/* determine if game lost (i.e. all cities blown up): */
if (!num_cities_alive)
{
- return GAME_OVER_LOST;
+ if (gameover_counter < 0)
+ gameover_counter = GAMEOVER_COUNTER_START;
+ gameover_counter--;
+ if (gameover_counter == 0)
+ return GAME_OVER_LOST;
}
/* determine if game won (i.e. all questions in mission answered correctly): */
@@ -2153,3 +2578,26 @@
strncpy(comets[i].flashcard.answer_string, " ", ANSWER_LEN);
}
}
+
+void print_status(void)
+{
+ int i;
+
+ printf("\nCities:");
+ printf("\nHits left: ");
+ for (i = 0; i < NUM_CITIES; i++)
+ printf("%02d ",cities[i].hits_left);
+ printf("\nStatus: ");
+ for (i = 0; i < NUM_CITIES; i++)
+ printf("%02d ",cities[i].status);
+
+ printf("\nPenguins:");
+ printf("\nStatus: ");
+ for (i = 0; i < NUM_CITIES; i++)
+ printf("%02d ",penguins[i].status);
+
+ printf("\nCloud:");
+ printf("\nStatus: %d",cloud.status);
+ printf("\nCity: %d",cloud.city);
+ printf("\n");
+}
Modified: tuxmath/trunk/src/game.h
===================================================================
--- tuxmath/trunk/src/game.h 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/game.h 2007-01-31 23:18:29 UTC (rev 74)
@@ -26,19 +26,62 @@
#define MAX_CITY_COLORS 4
-typedef struct city_type {
- int alive, expl, shields;
- int x;
-} city_type;
-
typedef struct laser_type {
int alive;
int x1, y1;
int x2, y2;
} laser_type;
+/* Note: both igloos and the original "cities" graphics are handled
+ with the "cities" structure.
+ hits_left holds the number of hits it can withstand before
+ being "dead". If using the original cities graphics,
+ 2 = with shield,
+ 1 = without shield,
+ 0 = dead
+ If using the igloo graphics,
+ 2 = intact,
+ 1 = half-melted
+ 0 = melted
+*/
+/* For both cities/igloos & penguins, the animation state is
+ controlled by "status", and "counter" is used for timing. We also
+ have "img" and "layer" so that the image can be pre-planned to have
+ a specific rendering order (so that foreground/background issues
+ are handled properly). Layer 0 is rendered first, then layer 1, and
+ so on. */
+typedef struct city_type {
+ int hits_left;
+ int status, counter;
+ int threatened; /* true if a comet is near */
+ int x;
+ int img,layer;
+} city_type;
+
+typedef struct penguin_type {
+ int status, counter;
+ int x;
+ int img,layer;
+} penguin_type;
+
+typedef struct steam_type {
+ int status, counter;
+ int img,layer;
+} steam_type;
+
+#define NUM_SNOWFLAKES 100
+
+typedef struct cloud_type {
+ int status;
+ int city;
+ int x,y;
+ int snowflake_x[NUM_SNOWFLAKES];
+ int snowflake_y[NUM_SNOWFLAKES];
+ int snowflake_size[NUM_SNOWFLAKES];
+} cloud_type;
+
enum {
GAME_IN_PROGRESS,
GAME_OVER_WON,
@@ -49,6 +92,42 @@
GAME_OVER_ERROR
};
+/* City animation status types */
+enum {
+ CITY_PRESENT,
+ CITY_EXPLODING,
+ CITY_EVAPORATING,
+ CITY_REBUILDING,
+ CITY_GONE
+};
+
+/* Penguin animation status types */
+enum {
+ PENGUIN_OFFSCREEN,
+ PENGUIN_HAPPY,
+ PENGUIN_FLAPPING,
+ PENGUIN_DUCKING,
+ PENGUIN_GRUMPY,
+ PENGUIN_WORRIED,
+ PENGUIN_WALKING_OFF,
+ PENGUIN_WALKING_ON,
+ PENGUIN_STANDING_UP,
+ PENGUIN_SITTING_DOWN,
+ PENGUIN_BOWING
+};
+
+/* Steam animation status types */
+enum {
+ STEAM_OFF,
+ STEAM_ON
+};
+
+/* Cloud & snowflake animation types */
+enum {
+ EXTRA_LIFE_OFF,
+ EXTRA_LIFE_ON
+};
+
int game(void);
/* draw_nums() is used in options.c so need extern linkage */
void draw_nums(char* str, int x, int y);
Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/setup.c 2007-01-31 23:18:29 UTC (rev 74)
@@ -52,6 +52,20 @@
/* (These are now 'extern'd in "tuxmath.h") */
SDL_Surface* screen;
SDL_Surface* images[NUM_IMAGES];
+/* Need special handling to generate flipped versions of images. This
+ is a slightly ugly hack arising from the use of the enum trick for
+ NUM_IMAGES. */
+#define NUM_FLIPPED_IMAGES 6
+SDL_Surface* flipped_images[NUM_FLIPPED_IMAGES];
+int flipped_img_lookup[NUM_IMAGES];
+const int flipped_img[] = {
+ IMG_PENGUIN_WALK_ON1,
+ IMG_PENGUIN_WALK_ON2,
+ IMG_PENGUIN_WALK_ON3,
+ IMG_PENGUIN_WALK_OFF1,
+ IMG_PENGUIN_WALK_OFF2,
+ IMG_PENGUIN_WALK_OFF3
+};
#ifndef NOSOUND
Mix_Chunk* sounds[NUM_SOUNDS];
@@ -64,6 +78,7 @@
void handle_command_args(int argc, char* argv[]);
void initialize_SDL(void);
void load_data_files(void);
+void generate_flipped_images(void);
//int initialize_game_options(void);
void seticon(void);
@@ -85,6 +100,8 @@
initialize_SDL();
/* Read image and sound files: */
load_data_files();
+ /* Generate flipped versions of walking images */
+ generate_flipped_images();
}
@@ -510,6 +527,22 @@
// }
}
+/* Create flipped versions of certain images; also set up the flip
+ lookup table */
+void generate_flipped_images(void)
+{
+ int i;
+
+ /* Zero out the flip lookup table */
+ for (i = 0; i < NUM_IMAGES; i++)
+ flipped_img_lookup[i] = 0;
+
+ for (i = 0; i < NUM_FLIPPED_IMAGES; i++) {
+ flipped_images[i] = flip(images[flipped_img[i]],1,0);
+ flipped_img_lookup[flipped_img[i]] = i;
+ }
+}
+
/* save options and free heap */
/* use for successful exit */
void cleanup(void)
Modified: tuxmath/trunk/src/titlescreen.c
===================================================================
--- tuxmath/trunk/src/titlescreen.c 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/titlescreen.c 2007-01-31 23:18:29 UTC (rev 74)
@@ -63,21 +63,21 @@
/* --- define menu structure --- */
/* (these values are all in the Game_Type enum in titlescreen.h) */
/* They are the "commands" associated with the menu items. */
-const int menu_item[][6]= {{0, 0, 0, 0, 0 },
- {0, LESSONS, ARCADE_CADET, LEVEL1, NOT_CODED },
- {0, ARCADE, ARCADE_SCOUT, LEVEL2, FREETYPE },
- {0, OPTIONS, ARCADE_RANGER, LEVEL3, PROJECT_INFO},
- {0, MORE_OPTIONS, ARCADE_ACE, LEVEL4, SET_LANGUAGE},
- {0, QUIT_GAME, MAIN, MAIN, MAIN }};
+const int menu_item[][6]= {{0, 0, 0, 0, 0 },
+ {0, LESSONS, ARCADE_CADET, INTERFACE_OPTIONS, NOT_CODED },
+ {0, ARCADE, ARCADE_SCOUT, HELP, FREETYPE },
+ {0, OPTIONS, ARCADE_RANGER, CREDITS, PROJECT_INFO},
+ {0, GAME_OPTIONS, ARCADE_ACE, PROJECT_INFO, SET_LANGUAGE},
+ {0, QUIT_GAME, MAIN, MAIN, MAIN }};
/* --- menu text --- */
const unsigned char* menu_text[][6]=
-/* Main Menu 'Arcade' Games Math Options Game Options */
+/* Main Menu 'Arcade' Games Options Game Options */
{{"", "", "", "", "" },
- {"", gettext_noop("Math Command Training Academy"), gettext_noop("Space Cadet"), gettext_noop("Addition"), gettext_noop("Speed") },
- {"", gettext_noop("Play Arcade Game"), gettext_noop("Scout"), gettext_noop("Subtraction"), gettext_noop("Sound") },
- {"", gettext_noop("Play Custom Game"), gettext_noop("Ranger"), gettext_noop("Multiplication"), gettext_noop("Graphics") },
- {"", gettext_noop("More Options"), gettext_noop("Ace"), gettext_noop("Division"), gettext_noop("Advanced Options")},
+ {"", gettext_noop("Math Command Training Academy"), gettext_noop("Space Cadet"), gettext_noop("Settings"), gettext_noop("Speed") },
+ {"", gettext_noop("Play Arcade Game"), gettext_noop("Scout"), gettext_noop("Help"), gettext_noop("Sound") },
+ {"", gettext_noop("Play Custom Game"), gettext_noop("Ranger"), gettext_noop("Credits"), gettext_noop("Graphics") },
+ {"", gettext_noop("More Options"), gettext_noop("Ace"), gettext_noop("Project Info"), gettext_noop("Advanced Options")},
{"", gettext_noop("Quit"), gettext_noop("Main Menu"), gettext_noop("Main Menu"), gettext_noop("Main Menu") }};
@@ -168,12 +168,10 @@
int done = 0;
int firstloop = 1;
int menu_opt = NONE;
- int sub_menu = NONE;
int update_locs = 1;
int redraw = 0;
int key_menu = 1;
int old_key_menu = 5;
- char phrase[128];
debugOn = 1; //for now
show_tux4kids = 1; //for now
@@ -197,8 +195,7 @@
yellow.r = 0xff; yellow.g = 0xff; yellow.b = 0x00;
- /* FIXME phrase(s) should come from file */
- strncpy( phrase, "Now is the time for all good men to come to the aid of their country.", 128);
+
start = SDL_GetTicks();
@@ -551,9 +548,8 @@
if (menu_opt == ARCADE) /* Go to Arcade submenu */
{
menu_depth = ARCADE_SUBMENU; /* i.e. 2 */
- sub_menu = ARCADE; /* i.e. 1 */
update_locs = 1;
- redraw=1;
+ redraw = 1;
}
@@ -583,10 +579,11 @@
}
- if (menu_opt == MORE_OPTIONS)
+ if (menu_opt == GAME_OPTIONS) /* Go to page three of menu system */
{
- NotImplemented();
- redraw = 1;
+ menu_depth = GAME_OPTIONS_SUBMENU; /* i.e. 3 */
+ update_locs = 1;
+ redraw=1;
}
@@ -717,31 +714,41 @@
redraw = 1;
}
- /* Rest of menu_opts are not currently used: */
-/*
- if (menu_opt == LASER)
+
+ /* Third (Game Options) page:-----------------------------------------------*/
+
+ if (menu_opt == INTERFACE_OPTIONS)
{
- menu_depth = LASER_SUBMENU;
- sub_menu = LASER;
- update_locs = 1;
+ NotImplemented();
redraw = 1;
}
- if (menu_opt == NOT_CODED)
+ if (menu_opt == HELP)
{
NotImplemented();
redraw = 1;
}
+ if (menu_opt == CREDITS)
+ {
+ TitleScreen_unload_media();
+ credits();
+ TitleScreen_load_media();
+ redraw = 1;
+ }
+
+
if (menu_opt == PROJECT_INFO)
{
+ NotImplemented();
// projectInfo();
redraw = 1;
}
-
+ /* Rest of menu_opts are not currently used: */
+/*
if (menu_opt == SET_LANGUAGE)
{
TitleScreen_unload_media();
Modified: tuxmath/trunk/src/titlescreen.h
===================================================================
--- tuxmath/trunk/src/titlescreen.h 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/titlescreen.h 2007-01-31 23:18:29 UTC (rev 74)
@@ -134,11 +134,12 @@
/* Menu Prototypes */
enum Game_Type {
- LESSONS, ARCADE, OPTIONS, MORE_OPTIONS, QUIT_GAME,
+ LESSONS, ARCADE, OPTIONS, GAME_OPTIONS, QUIT_GAME,
ARCADE_CADET, ARCADE_SCOUT, ARCADE_RANGER, ARCADE_ACE, MAIN,
- HELP, INSTRUCT_CASCADE, CASCADE1, CASCADE2, CASCADE3, CASCADE4,
+ INTERFACE_OPTIONS, HELP, CREDITS, PROJECT_INFO,
+ INSTRUCT_CASCADE, CASCADE1, CASCADE2, CASCADE3, CASCADE4,
INSTRUCT_LASER, LASER1, LASER2, LASER3, LASER4,
- FREETYPE, ASDF, ALL, SET_LANGUAGE, PROJECT_INFO, EDIT_WORDLIST,
+ FREETYPE, ASDF, ALL, SET_LANGUAGE, EDIT_WORDLIST,
LEVEL1, LEVEL2, LEVEL3, LEVEL4, LASER, INSTRUCT, NOT_CODED, NONE};
/* Title sequence constants */
@@ -227,7 +228,7 @@
#define TITLE_MENU_DEPTH 4
#define OPTIONS_SUBMENU 4
-#define LASER_SUBMENU 3
+#define GAME_OPTIONS_SUBMENU 3
#define ARCADE_SUBMENU 2
#define ROOTMENU 1
Modified: tuxmath/trunk/src/tuxmath.h
===================================================================
--- tuxmath/trunk/src/tuxmath.h 2007-01-25 17:35:20 UTC (rev 73)
+++ tuxmath/trunk/src/tuxmath.h 2007-01-31 23:18:29 UTC (rev 74)
@@ -110,6 +110,8 @@
extern SDL_Surface* screen; /* declared in setup.c; also used in game.c, options.c, fileops.c, credits.c, title.c */
extern SDL_Surface* images[]; /* declared in setup.c, used in same files as screen */
+extern SDL_Surface* flipped_images[];
+extern int flipped_img_lookup[];
#ifndef NOSOUND
extern Mix_Chunk* sounds[]; /* declared in setup.c; also used in fileops.c, playsound.c */
extern Mix_Music* musics[]; /* declared in setup.c; also used in fileops.c, game.c */
More information about the Tux4kids-commits
mailing list