Commit 03d07cb5 authored by Gabriel Ivascu's avatar Gabriel Ivascu Committed by Iulian Radu

Move teensy classes, structs and enums at the top of the files

https://bugzilla.gnome.org/show_bug.cgi?id=754608
parent c2f6a827
......@@ -19,6 +19,36 @@
// This is a fairly literal translation of the LGPLv2+ original by
// Sean MacIsaac, Ian Peters, Guillaume Béland.
public enum BonusType
{
REGULAR,
HALF,
DOUBLE,
LIFE,
REVERSE,
CUT,
SWITCH,
WARP
}
public class Bonus : Object
{
public int x;
public int y;
public BonusType type;
public bool fake;
public int countdown;
public Bonus (int x, int y, BonusType type, bool fake, int countdown)
{
this.x = x;
this.y = y;
this.type = type;
this.fake = fake;
this.countdown = countdown;
}
}
public class Boni : Object
{
public Gee.LinkedList<Bonus> bonuses;
......@@ -93,33 +123,3 @@ public class Boni : Object
return null;
}
}
public class Bonus : Object
{
public int x;
public int y;
public BonusType type;
public bool fake;
public int countdown;
public Bonus (int x, int y, BonusType type, bool fake, int countdown)
{
this.x = x;
this.y = y;
this.type = type;
this.fake = fake;
this.countdown = countdown;
}
}
public enum BonusType
{
REGULAR,
HALF,
DOUBLE,
LIFE,
REVERSE,
CUT,
SWITCH,
WARP
}
......@@ -16,6 +16,98 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
private class WormActor : Clutter.Actor
{
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
set_easing_duration (NibblesGame.GAMEDELAY * 26);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public override void hide ()
{
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (0.4f, 0.4f);
set_opacity (0);
restore_easing_state ();
}
}
private class BonusTexture : GtkClutter.Texture
{
public static const float SIZE_MULTIPLIER = 2;
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BOUNCE);
set_easing_duration (NibblesGame.GAMEDELAY * 20);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public new void set_size (float width, float height)
{
base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
}
}
private class WarpTexture: GtkClutter.Texture
{
public static const float SIZE_MULTIPLIER = 2;
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public override void hide ()
{
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (0.4f, 0.4f);
set_pivot_point (0.5f, 0.5f);
set_opacity (0);
restore_easing_state ();
}
public new void set_size (float width, float height)
{
base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
}
}
public class NibblesView : GtkClutter.Embed
{
/* Sound */
......@@ -835,95 +927,3 @@ public class NibblesView : GtkClutter.Embed
return color_lookup[colorval];
}
}
private class WormActor : Clutter.Actor
{
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
set_easing_duration (NibblesGame.GAMEDELAY * 26);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public override void hide ()
{
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (0.4f, 0.4f);
set_opacity (0);
restore_easing_state ();
}
}
private class BonusTexture : GtkClutter.Texture
{
public static const float SIZE_MULTIPLIER = 2;
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BOUNCE);
set_easing_duration (NibblesGame.GAMEDELAY * 20);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public new void set_size (float width, float height)
{
base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
}
}
private class WarpTexture: GtkClutter.Texture
{
public static const float SIZE_MULTIPLIER = 2;
public override void show ()
{
base.show ();
set_opacity (0);
set_scale (3.0, 3.0);
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (1.0, 1.0);
set_pivot_point (0.5f, 0.5f);
set_opacity (0xff);
restore_easing_state ();
}
public override void hide ()
{
save_easing_state ();
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
set_easing_duration (NibblesGame.GAMEDELAY * 15);
set_scale (0.4f, 0.4f);
set_pivot_point (0.5f, 0.5f);
set_opacity (0);
restore_easing_state ();
}
public new void set_size (float width, float height)
{
base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
}
}
......@@ -19,6 +19,30 @@
// This is a fairly literal translation of the LGPLv2+ original by
// Sean MacIsaac, Ian Peters, Guillaume Béland.
public enum WormDirection
{
NONE,
RIGHT,
DOWN,
LEFT,
UP
}
public struct Position
{
int x;
int y;
}
public struct WormProperties
{
int color;
uint up;
uint down;
uint left;
uint right;
}
public class Worm : Object
{
public const int STARTING_LENGTH = 5;
......@@ -762,27 +786,3 @@ public class Worm : Object
}
}
}
public struct Position
{
int x;
int y;
}
public enum WormDirection
{
NONE,
RIGHT,
DOWN,
LEFT,
UP
}
public struct WormProperties
{
int color;
uint up;
uint down;
uint left;
uint right;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment