Deleted directory, which will be replaced by a git submodule
This commit is contained in:
parent
68b9aff1ca
commit
0011a61ed5
File diff suppressed because it is too large
Load Diff
@ -1,703 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Def
|
||||
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using static WindowsPhoneSpeedyBlupi.Def;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
|
||||
public static class Def
|
||||
{
|
||||
|
||||
public enum Phase
|
||||
{
|
||||
None,
|
||||
First,
|
||||
Wait,
|
||||
Init,
|
||||
Play,
|
||||
Pause,
|
||||
Lost,
|
||||
Win,
|
||||
Trial,
|
||||
MainSetup,
|
||||
PlaySetup,
|
||||
Resume,
|
||||
Ranking
|
||||
}
|
||||
|
||||
public enum ButtonGlyph
|
||||
{
|
||||
None,
|
||||
InitGamerA,
|
||||
InitGamerB,
|
||||
InitGamerC,
|
||||
InitSetup,
|
||||
InitPlay,
|
||||
InitBuy,
|
||||
InitRanking,
|
||||
WinLostReturn,
|
||||
TrialBuy,
|
||||
TrialCancel,
|
||||
SetupSounds,
|
||||
SetupJump,
|
||||
SetupZoom,
|
||||
SetupAccel,
|
||||
SetupReset,
|
||||
SetupReturn,
|
||||
PauseMenu,
|
||||
PauseBack,
|
||||
PauseSetup,
|
||||
PauseRestart,
|
||||
PauseContinue,
|
||||
PlayPause,
|
||||
PlayJump,
|
||||
PlayAction,
|
||||
PlayDown,
|
||||
ResumeMenu,
|
||||
ResumeContinue,
|
||||
RankingContinue,
|
||||
Cheat11,
|
||||
Cheat12,
|
||||
Cheat21,
|
||||
Cheat22,
|
||||
Cheat31,
|
||||
Cheat32,
|
||||
Cheat1,
|
||||
Cheat2,
|
||||
Cheat3,
|
||||
Cheat4,
|
||||
Cheat5,
|
||||
Cheat6,
|
||||
Cheat7,
|
||||
Cheat8,
|
||||
Cheat9
|
||||
}
|
||||
|
||||
public const int LXIMAGE = 640;
|
||||
|
||||
public const int LYIMAGE = 480;
|
||||
|
||||
public const int MAXCELX = 100;
|
||||
|
||||
public const int MAXCELY = 100;
|
||||
|
||||
public const int DIMOBJX = 64;
|
||||
|
||||
public const int DIMOBJY = 64;
|
||||
|
||||
public const int DIMBLUPIX = 60;
|
||||
|
||||
public const int DIMBLUPIY = 60;
|
||||
|
||||
public const int DIMEXPLOX = 128;
|
||||
|
||||
public const int DIMEXPLOY = 128;
|
||||
|
||||
public const int DIMBUTTONX = 40;
|
||||
|
||||
public const int DIMBUTTONY = 40;
|
||||
|
||||
public const int DIMJAUGEX = 124;
|
||||
|
||||
public const int DIMJAUGEY = 22;
|
||||
|
||||
public const int POSSTATX = 12;
|
||||
|
||||
public const int POSSTATY = 220;
|
||||
|
||||
public const int DIMSTATX = 60;
|
||||
|
||||
public const int DIMSTATY = 30;
|
||||
|
||||
public const int DIMTEXTX = 32;
|
||||
|
||||
public const int DIMTEXTY = 32;
|
||||
|
||||
public const int CHOBJECT = 1;
|
||||
|
||||
public const int CHBLUPI = 2;
|
||||
|
||||
public const int CHDECOR = 3;
|
||||
|
||||
public const int CHBUTTON = 4;
|
||||
|
||||
public const int CHJAUGE = 5;
|
||||
|
||||
public const int CHTEXT = 6;
|
||||
|
||||
public const int CHEXPLO = 9;
|
||||
|
||||
public const int CHELEMENT = 10;
|
||||
|
||||
public const int CHBLUPI1 = 11;
|
||||
|
||||
public const int CHBLUPI2 = 12;
|
||||
|
||||
public const int CHBLUPI3 = 13;
|
||||
|
||||
public const int CHPAD = 14;
|
||||
|
||||
public const int CHSPEEDYBLUPI = 15;
|
||||
|
||||
public const int CHBLUPIYOUPIE = 16;
|
||||
|
||||
public const int CHGEAR = 17;
|
||||
|
||||
public const int ACTION_STOP = 1;
|
||||
|
||||
public const int ACTION_MARCH = 2;
|
||||
|
||||
public const int ACTION_TURN = 3;
|
||||
|
||||
public const int ACTION_JUMP = 4;
|
||||
|
||||
public const int ACTION_AIR = 5;
|
||||
|
||||
public const int ACTION_DOWN = 6;
|
||||
|
||||
public const int ACTION_UP = 7;
|
||||
|
||||
public const int ACTION_VERTIGO = 8;
|
||||
|
||||
public const int ACTION_RECEDE = 9;
|
||||
|
||||
public const int ACTION_ADVANCE = 10;
|
||||
|
||||
public const int ACTION_CLEAR1 = 11;
|
||||
|
||||
public const int ACTION_SET = 12;
|
||||
|
||||
public const int ACTION_WIN = 13;
|
||||
|
||||
public const int ACTION_PUSH = 14;
|
||||
|
||||
public const int ACTION_STOPHELICO = 15;
|
||||
|
||||
public const int ACTION_MARCHHELICO = 16;
|
||||
|
||||
public const int ACTION_TURNHELICO = 17;
|
||||
|
||||
public const int ACTION_STOPNAGE = 18;
|
||||
|
||||
public const int ACTION_MARCHNAGE = 19;
|
||||
|
||||
public const int ACTION_TURNNAGE = 20;
|
||||
|
||||
public const int ACTION_STOPSURF = 21;
|
||||
|
||||
public const int ACTION_MARCHSURF = 22;
|
||||
|
||||
public const int ACTION_TURNSURF = 23;
|
||||
|
||||
public const int ACTION_DROWN = 24;
|
||||
|
||||
public const int ACTION_STOPJEEP = 25;
|
||||
|
||||
public const int ACTION_MARCHJEEP = 26;
|
||||
|
||||
public const int ACTION_TURNJEEP = 27;
|
||||
|
||||
public const int ACTION_STOPPOP = 28;
|
||||
|
||||
public const int ACTION_POP = 29;
|
||||
|
||||
public const int ACTION_BYE = 30;
|
||||
|
||||
public const int ACTION_STOPSUSPEND = 31;
|
||||
|
||||
public const int ACTION_MARCHSUSPEND = 32;
|
||||
|
||||
public const int ACTION_TURNSUSPEND = 33;
|
||||
|
||||
public const int ACTION_JUMPSUSPEND = 34;
|
||||
|
||||
public const int ACTION_HIDE = 35;
|
||||
|
||||
public const int ACTION_JUMPAIE = 36;
|
||||
|
||||
public const int ACTION_STOPSKATE = 37;
|
||||
|
||||
public const int ACTION_MARCHSKATE = 38;
|
||||
|
||||
public const int ACTION_TURNSKATE = 39;
|
||||
|
||||
public const int ACTION_JUMPSKATE = 40;
|
||||
|
||||
public const int ACTION_AIRSKATE = 41;
|
||||
|
||||
public const int ACTION_TAKESKATE = 42;
|
||||
|
||||
public const int ACTION_DEPOSESKATE = 43;
|
||||
|
||||
public const int ACTION_OUF1a = 44;
|
||||
|
||||
public const int ACTION_OUF1b = 45;
|
||||
|
||||
public const int ACTION_OUF2 = 46;
|
||||
|
||||
public const int ACTION_OUF3 = 47;
|
||||
|
||||
public const int ACTION_OUF4 = 48;
|
||||
|
||||
public const int ACTION_SUCETTE = 49;
|
||||
|
||||
public const int ACTION_STOPTANK = 50;
|
||||
|
||||
public const int ACTION_MARCHTANK = 51;
|
||||
|
||||
public const int ACTION_TURNTANK = 52;
|
||||
|
||||
public const int ACTION_FIRETANK = 53;
|
||||
|
||||
public const int ACTION_GLU = 54;
|
||||
|
||||
public const int ACTION_DRINK = 55;
|
||||
|
||||
public const int ACTION_CHARGE = 56;
|
||||
|
||||
public const int ACTION_ELECTRO = 57;
|
||||
|
||||
public const int ACTION_HELICOGLU = 58;
|
||||
|
||||
public const int ACTION_TURNAIR = 59;
|
||||
|
||||
public const int ACTION_STOPMARCH = 60;
|
||||
|
||||
public const int ACTION_STOPJUMP = 61;
|
||||
|
||||
public const int ACTION_STOPJUMPh = 62;
|
||||
|
||||
public const int ACTION_MOCKERY = 63;
|
||||
|
||||
public const int ACTION_MOCKERYi = 64;
|
||||
|
||||
public const int ACTION_OUF5 = 65;
|
||||
|
||||
public const int ACTION_BALLOON = 66;
|
||||
|
||||
public const int ACTION_STOPOVER = 67;
|
||||
|
||||
public const int ACTION_MARCHOVER = 68;
|
||||
|
||||
public const int ACTION_TURNOVER = 69;
|
||||
|
||||
public const int ACTION_RECEDEq = 70;
|
||||
|
||||
public const int ACTION_ADVANCEq = 71;
|
||||
|
||||
public const int ACTION_STOPECRASE = 72;
|
||||
|
||||
public const int ACTION_MARCHECRASE = 73;
|
||||
|
||||
public const int ACTION_TELEPORTE = 74;
|
||||
|
||||
public const int ACTION_CLEAR2 = 75;
|
||||
|
||||
public const int ACTION_CLEAR3 = 76;
|
||||
|
||||
public const int ACTION_CLEAR4 = 77;
|
||||
|
||||
public const int ACTION_CLEAR5 = 78;
|
||||
|
||||
public const int ACTION_CLEAR6 = 79;
|
||||
|
||||
public const int ACTION_CLEAR7 = 80;
|
||||
|
||||
public const int ACTION_CLEAR8 = 81;
|
||||
|
||||
public const int ACTION_SWITCH = 82;
|
||||
|
||||
public const int ACTION_MOCKERYp = 83;
|
||||
|
||||
public const int ACTION_NON = 84;
|
||||
|
||||
public const int ACTION_SLOWDOWNSKATE = 85;
|
||||
|
||||
public const int ACTION_TAKEDYNAMITE = 86;
|
||||
|
||||
public const int ACTION_PUTDYNAMITE = 87;
|
||||
|
||||
public const int DIR_LEFT = 1;
|
||||
|
||||
public const int DIR_RIGHT = 2;
|
||||
|
||||
public const int SEC_SHIELD = 1;
|
||||
|
||||
public const int SEC_POWER = 2;
|
||||
|
||||
public const int SEC_CLOUD = 3;
|
||||
|
||||
public const int SEC_HIDE = 4;
|
||||
|
||||
public const int TYPE_ASCENSEUR = 1;
|
||||
|
||||
public const int TYPE_BOMBEDOWN = 2;
|
||||
|
||||
public const int TYPE_BOMBEUP = 3;
|
||||
|
||||
public const int TYPE_BULLDOZER = 4;
|
||||
|
||||
public const int TYPE_TRESOR = 5;
|
||||
|
||||
public const int TYPE_EGG = 6;
|
||||
|
||||
public const int TYPE_GOAL = 7;
|
||||
|
||||
public const int TYPE_EXPLO1 = 8;
|
||||
|
||||
public const int TYPE_EXPLO2 = 9;
|
||||
|
||||
public const int TYPE_EXPLO3 = 10;
|
||||
|
||||
public const int TYPE_EXPLO4 = 11;
|
||||
|
||||
public const int TYPE_CAISSE = 12;
|
||||
|
||||
public const int TYPE_HELICO = 13;
|
||||
|
||||
public const int TYPE_PLOUF = 14;
|
||||
|
||||
public const int TYPE_BLUP = 15;
|
||||
|
||||
public const int TYPE_BOMBEMOVE = 16;
|
||||
|
||||
public const int TYPE_POISSON = 17;
|
||||
|
||||
public const int TYPE_TOMATES = 18;
|
||||
|
||||
public const int TYPE_JEEP = 19;
|
||||
|
||||
public const int TYPE_OISEAU = 20;
|
||||
|
||||
public const int TYPE_CLE = 21;
|
||||
|
||||
public const int TYPE_DOOR = 22;
|
||||
|
||||
public const int TYPE_BALLE = 23;
|
||||
|
||||
public const int TYPE_SKATE = 24;
|
||||
|
||||
public const int TYPE_SHIELD = 25;
|
||||
|
||||
public const int TYPE_POWER = 26;
|
||||
|
||||
public const int TYPE_MAGICTRACK = 27;
|
||||
|
||||
public const int TYPE_TANK = 28;
|
||||
|
||||
public const int TYPE_BULLET = 29;
|
||||
|
||||
public const int TYPE_DRINK = 30;
|
||||
|
||||
public const int TYPE_CHARGE = 31;
|
||||
|
||||
public const int TYPE_BLUPIHELICO = 32;
|
||||
|
||||
public const int TYPE_BLUPITANK = 33;
|
||||
|
||||
public const int TYPE_GLU = 34;
|
||||
|
||||
public const int TYPE_TIPLOUF = 35;
|
||||
|
||||
public const int TYPE_POLLUTION = 36;
|
||||
|
||||
public const int TYPE_CLEAR = 37;
|
||||
|
||||
public const int TYPE_ELECTRO = 38;
|
||||
|
||||
public const int TYPE_TRESORTRACK = 39;
|
||||
|
||||
public const int TYPE_INVERT = 40;
|
||||
|
||||
public const int TYPE_INVERTSTART = 41;
|
||||
|
||||
public const int TYPE_INVERTSTOP = 42;
|
||||
|
||||
public const int TYPE_GUEPE = 44;
|
||||
|
||||
public const int TYPE_OVER = 46;
|
||||
|
||||
public const int TYPE_ASCENSEURs = 47;
|
||||
|
||||
public const int TYPE_ASCENSEURsi = 48;
|
||||
|
||||
public const int TYPE_CLE1 = 49;
|
||||
|
||||
public const int TYPE_CLE2 = 50;
|
||||
|
||||
public const int TYPE_CLE3 = 51;
|
||||
|
||||
public const int TYPE_BRIDGE = 52;
|
||||
|
||||
public const int TYPE_TENTACULE = 53;
|
||||
|
||||
public const int TYPE_CREATURE = 54;
|
||||
|
||||
public const int TYPE_DYNAMITE = 55;
|
||||
|
||||
public const int TYPE_DYNAMITEf = 56;
|
||||
|
||||
public const int TYPE_SHIELDTRACK = 57;
|
||||
|
||||
public const int TYPE_HIDETRACK = 58;
|
||||
|
||||
public const int TYPE_EXPLO5 = 90;
|
||||
|
||||
public const int TYPE_EXPLO6 = 91;
|
||||
|
||||
public const int TYPE_EXPLO7 = 92;
|
||||
|
||||
public const int TYPE_EXPLO8 = 93;
|
||||
|
||||
public const int TYPE_EXPLO9 = 94;
|
||||
|
||||
public const int TYPE_EXPLO10 = 95;
|
||||
|
||||
public const int TYPE_BOMBEFOLLOW1 = 96;
|
||||
|
||||
public const int TYPE_BOMBEFOLLOW2 = 97;
|
||||
|
||||
public const int TYPE_SPLOUTCH1 = 98;
|
||||
|
||||
public const int TYPE_SPLOUTCH2 = 99;
|
||||
|
||||
public const int TYPE_SPLOUTCH3 = 100;
|
||||
|
||||
public const int TYPE_BOMBEPERSO1 = 200;
|
||||
|
||||
public const int TYPE_BOMBEPERSO2 = 201;
|
||||
|
||||
public const int TYPE_BOMBEPERSO3 = 202;
|
||||
|
||||
public const int TYPE_BOMBEPERSO4 = 203;
|
||||
|
||||
public const int STEP_STOPSTART = 1;
|
||||
|
||||
public const int STEP_ADVANCE = 2;
|
||||
|
||||
public const int STEP_STOPEND = 3;
|
||||
|
||||
public const int STEP_RECEDE = 4;
|
||||
|
||||
public const int DECOR_EXPLO1 = 1;
|
||||
|
||||
public const int DECOR_EXPLO2 = 2;
|
||||
|
||||
public const int DECOR_EXPLO3 = 3;
|
||||
|
||||
public const int DECOR_EXPLO4 = 4;
|
||||
|
||||
public const int DECOR_BALLOON = 5;
|
||||
|
||||
public const int SOUND_CLICK = 0;
|
||||
|
||||
public const int SOUND_JUMP1 = 1;
|
||||
|
||||
public const int SOUND_JUMP2 = 2;
|
||||
|
||||
public const int SOUND_JUMPEND = 3;
|
||||
|
||||
public const int SOUND_JUMPTOC = 4;
|
||||
|
||||
public const int SOUND_TURN = 5;
|
||||
|
||||
public const int SOUND_VERTIGO = 6;
|
||||
|
||||
public const int SOUND_DOWN = 7;
|
||||
|
||||
public const int SOUND_FALL = 8;
|
||||
|
||||
public const int SOUND_NEW = 9;
|
||||
|
||||
public const int SOUND_BOUM = 10;
|
||||
|
||||
public const int SOUND_TRESOR = 11;
|
||||
|
||||
public const int SOUND_EGG = 12;
|
||||
|
||||
public const int SOUND_ENDKO = 13;
|
||||
|
||||
public const int SOUND_ENDOK = 14;
|
||||
|
||||
public const int SOUND_HELICOSTART = 15;
|
||||
|
||||
public const int SOUND_HELICOHIGH = 16;
|
||||
|
||||
public const int SOUND_HELICOSTOP = 17;
|
||||
|
||||
public const int SOUND_HELICOLOW = 18;
|
||||
|
||||
public const int SOUND_LASTTRESOR = 19;
|
||||
|
||||
public const int SOUND_UP = 20;
|
||||
|
||||
public const int SOUND_LOOKUP = 21;
|
||||
|
||||
public const int SOUND_JUMP0 = 22;
|
||||
|
||||
public const int SOUND_PLOUF = 23;
|
||||
|
||||
public const int SOUND_BLUP = 24;
|
||||
|
||||
public const int SOUND_SURF = 25;
|
||||
|
||||
public const int SOUND_DROWN = 26;
|
||||
|
||||
public const int SOUND_ERROR = 27;
|
||||
|
||||
public const int SOUND_JEEPSTART = 28;
|
||||
|
||||
public const int SOUND_JEEPHIGH = 29;
|
||||
|
||||
public const int SOUND_JEEPSTOP = 30;
|
||||
|
||||
public const int SOUND_JEEPLOW = 31;
|
||||
|
||||
public const int SOUND_BYE = 32;
|
||||
|
||||
public const int SOUND_DOOR = 33;
|
||||
|
||||
public const int SOUND_SUSPENDTOC = 34;
|
||||
|
||||
public const int SOUND_SUSPENDJUMP = 35;
|
||||
|
||||
public const int SOUND_SINGE = 36;
|
||||
|
||||
public const int SOUND_PATIENT = 37;
|
||||
|
||||
public const int SOUND_PUSH = 38;
|
||||
|
||||
public const int SOUND_POP = 39;
|
||||
|
||||
public const int SOUND_JUMPAIE = 40;
|
||||
|
||||
public const int SOUND_RESSORT = 41;
|
||||
|
||||
public const int SOUND_STARTSHIELD = 42;
|
||||
|
||||
public const int SOUND_STOPSHIELD = 43;
|
||||
|
||||
public const int SOUND_STARTPOWER = 44;
|
||||
|
||||
public const int SOUND_STOPPOWER = 45;
|
||||
|
||||
public const int SOUND_OUF1 = 46;
|
||||
|
||||
public const int SOUND_OUF2 = 47;
|
||||
|
||||
public const int SOUND_OUF3 = 48;
|
||||
|
||||
public const int SOUND_OUF4 = 49;
|
||||
|
||||
public const int SOUND_SUCETTE = 50;
|
||||
|
||||
public const int SOUND_GLU = 51;
|
||||
|
||||
public const int SOUND_FIREOK = 52;
|
||||
|
||||
public const int SOUND_FIREKO = 53;
|
||||
|
||||
public const int SOUND_TAKEGLU = 54;
|
||||
|
||||
public const int SOUND_STARTCLOUD = 55;
|
||||
|
||||
public const int SOUND_STOPCLOUD = 56;
|
||||
|
||||
public const int SOUND_DRINK = 57;
|
||||
|
||||
public const int SOUND_CHARGE = 58;
|
||||
|
||||
public const int SOUND_ELECTRO = 59;
|
||||
|
||||
public const int SOUND_PERSOTAKE = 60;
|
||||
|
||||
public const int SOUND_PERSOPOSE = 61;
|
||||
|
||||
public const int SOUND_STARTHIDE = 62;
|
||||
|
||||
public const int SOUND_STOPHIDE = 63;
|
||||
|
||||
public const int SOUND_TIPLOUF = 64;
|
||||
|
||||
public const int SOUND_MOCKERY = 65;
|
||||
|
||||
public const int SOUND_INVERTSTART = 66;
|
||||
|
||||
public const int SOUND_INVERTSTOP = 67;
|
||||
|
||||
public const int SOUND_OVERSTOP = 68;
|
||||
|
||||
public const int SOUND_BLITZ = 69;
|
||||
|
||||
public const int SOUND_ECRASE = 70;
|
||||
|
||||
public const int SOUND_TELEPORTE = 71;
|
||||
|
||||
public const int SOUND_BRIDGE1 = 72;
|
||||
|
||||
public const int SOUND_BRIDGE2 = 73;
|
||||
|
||||
public const int SOUND_ANGEL = 74;
|
||||
|
||||
public const int SOUND_SCIE = 75;
|
||||
|
||||
public const int SOUND_SWITCHOFF = 76;
|
||||
|
||||
public const int SOUND_SWITCHON = 77;
|
||||
|
||||
public const int SOUND_JUMPENDb = 78;
|
||||
|
||||
public const int SOUND_JUMPTOCb = 79;
|
||||
|
||||
public const int SOUND_JUMPENDm = 80;
|
||||
|
||||
public const int SOUND_JUMPTOCm = 81;
|
||||
|
||||
public const int SOUND_JUMPENDg = 82;
|
||||
|
||||
public const int SOUND_JUMPTOCg = 83;
|
||||
|
||||
public const int SOUND_JUMPENDo = 84;
|
||||
|
||||
public const int SOUND_JUMPTOCo = 85;
|
||||
|
||||
public const int SOUND_JUMPENDk = 86;
|
||||
|
||||
public const int SOUND_JUMPTOCk = 87;
|
||||
|
||||
public const int SOUND_JUMPENDf = 88;
|
||||
|
||||
public const int SOUND_JUMPTOCf = 89;
|
||||
|
||||
public const int SOUND_JUMPENDh = 90;
|
||||
|
||||
public const int SOUND_JUMPTOCh = 91;
|
||||
|
||||
public const int SOUND_FOLLOW = 92;
|
||||
|
||||
public const int KEY_JUMP = 1;
|
||||
|
||||
public const int KEY_FIRE = 2;
|
||||
|
||||
public const int KEY_DOWN = 4;
|
||||
|
||||
public static bool HasSound
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool EasyMove
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using static WindowsPhoneSpeedyBlupi.Xna;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public static class Env
|
||||
{
|
||||
public static bool DETAILED_DEBUGGING { get; set; }
|
||||
|
||||
public static Platform PLATFORM { get; private set; }
|
||||
public static XnaImpl XNA_IMPL { get; private set; }
|
||||
public static bool INITIALIZED { get; private set; }
|
||||
|
||||
public static void init(XnaImpl xnaImpl, Platform platformIn)
|
||||
{
|
||||
if(INITIALIZED)
|
||||
{
|
||||
throw new Exception("Env was already initialized. Cannot call the init method again.");
|
||||
}
|
||||
XNA_IMPL = xnaImpl;
|
||||
PLATFORM = platformIn;
|
||||
INITIALIZED = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,988 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Game1
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.GamerServices;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Input.Touch;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Game1 : Game
|
||||
{
|
||||
private static readonly double[] waitTable = new double[24]
|
||||
{
|
||||
0.1, 7.0, 0.2, 20.0, 0.25, 22.0, 0.45, 50.0, 0.6, 53.0,
|
||||
0.65, 58.0, 0.68, 60.0, 0.8, 70.0, 0.84, 75.0, 0.9, 84.0,
|
||||
0.94, 91.0, 1.0, 100.0
|
||||
};
|
||||
|
||||
private static readonly Def.ButtonGlyph[] cheatGeste = new Def.ButtonGlyph[10]
|
||||
{
|
||||
Def.ButtonGlyph.Cheat12,
|
||||
Def.ButtonGlyph.Cheat22,
|
||||
Def.ButtonGlyph.Cheat32,
|
||||
Def.ButtonGlyph.Cheat12,
|
||||
Def.ButtonGlyph.Cheat11,
|
||||
Def.ButtonGlyph.Cheat21,
|
||||
Def.ButtonGlyph.Cheat22,
|
||||
Def.ButtonGlyph.Cheat21,
|
||||
Def.ButtonGlyph.Cheat31,
|
||||
Def.ButtonGlyph.Cheat32
|
||||
};
|
||||
|
||||
private readonly GraphicsDeviceManager graphics;
|
||||
|
||||
private readonly Pixmap pixmap;
|
||||
|
||||
private readonly Sound sound;
|
||||
|
||||
private readonly Decor decor;
|
||||
|
||||
private readonly InputPad inputPad;
|
||||
|
||||
private readonly GameData gameData;
|
||||
|
||||
private Def.Phase phase;
|
||||
|
||||
private TimeSpan startTime;
|
||||
|
||||
private int missionToStart1;
|
||||
|
||||
private int missionToStart2;
|
||||
|
||||
private int mission;
|
||||
|
||||
private int cheatGesteIndex;
|
||||
|
||||
private int continueMission;
|
||||
|
||||
private Jauge waitJauge;
|
||||
|
||||
private double waitProgress;
|
||||
|
||||
private bool isTrialMode;
|
||||
|
||||
private bool simulateTrialMode;
|
||||
|
||||
private bool playSetup;
|
||||
|
||||
private int phaseTime;
|
||||
|
||||
private Def.Phase fadeOutPhase;
|
||||
|
||||
private int fadeOutMission;
|
||||
|
||||
public bool IsRankingMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTrialMode
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!simulateTrialMode)
|
||||
{
|
||||
return isTrialMode;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public Game1()
|
||||
{
|
||||
if(!Env.INITIALIZED)
|
||||
{
|
||||
throw new Exception("Fatal error: Not initialized. Env.init() was not called.");
|
||||
}
|
||||
Exiting += OnExiting;
|
||||
if(!TouchPanel.GetCapabilities().IsConnected)
|
||||
{
|
||||
this.IsMouseVisible = true;
|
||||
Mouse.SetCursor(MouseCursor.Arrow);
|
||||
}
|
||||
graphics = new GraphicsDeviceManager(this);
|
||||
graphics.IsFullScreen = false;
|
||||
base.Content.RootDirectory = "Content";
|
||||
base.TargetElapsedTime = TimeSpan.FromTicks(500000L);
|
||||
base.InactiveSleepTime = TimeSpan.FromSeconds(1.0);
|
||||
missionToStart1 = -1;
|
||||
missionToStart2 = -1;
|
||||
gameData = new GameData();
|
||||
pixmap = new Pixmap(this, graphics);
|
||||
sound = new Sound(this, gameData);
|
||||
decor = new Decor();
|
||||
decor.Create(sound, pixmap, gameData);
|
||||
TinyPoint pos = new TinyPoint
|
||||
{
|
||||
X = 196,
|
||||
Y = 426
|
||||
};
|
||||
waitJauge = new Jauge();
|
||||
waitJauge.Create(pixmap, sound, pos, 3, false);
|
||||
waitJauge.SetHide(false);
|
||||
waitJauge.Zoom = 2.0;
|
||||
phase = Def.Phase.None;
|
||||
fadeOutPhase = Def.Phase.None;
|
||||
inputPad = new InputPad(this, decor, pixmap, sound, gameData);
|
||||
SetPhase(Def.Phase.First);
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
protected override void LoadContent()
|
||||
{
|
||||
pixmap.BackgroundCache("wait");
|
||||
}
|
||||
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDeactivated(object sender, EventArgs args)
|
||||
{
|
||||
if (phase == Def.Phase.Play)
|
||||
{
|
||||
decor.CurrentWrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
decor.CurrentDelete();
|
||||
}
|
||||
base.OnDeactivated(sender, args);
|
||||
}
|
||||
|
||||
protected override void OnActivated(object sender, EventArgs args)
|
||||
{
|
||||
continueMission = 1;
|
||||
base.OnActivated(sender, args);
|
||||
}
|
||||
|
||||
protected void OnExiting(object sender, EventArgs args)
|
||||
{
|
||||
decor.CurrentDelete();
|
||||
}
|
||||
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
|
||||
{
|
||||
if (phase == Def.Phase.Play)
|
||||
{
|
||||
SetPhase(Def.Phase.Pause);
|
||||
}
|
||||
else if (phase == Def.Phase.PlaySetup)
|
||||
{
|
||||
SetPhase(Def.Phase.Play, -1);
|
||||
}
|
||||
else if (phase != Def.Phase.Init)
|
||||
{
|
||||
SetPhase(Def.Phase.Init);
|
||||
}
|
||||
else
|
||||
{
|
||||
Exit();
|
||||
}
|
||||
return;
|
||||
}
|
||||
phaseTime++;
|
||||
if (fadeOutPhase != 0)
|
||||
{
|
||||
if (phaseTime >= 20)
|
||||
{
|
||||
SetPhase(fadeOutPhase);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (missionToStart2 != -1)
|
||||
{
|
||||
SetPhase(Def.Phase.Play, missionToStart2);
|
||||
return;
|
||||
}
|
||||
if (phase == Def.Phase.First)
|
||||
{
|
||||
startTime = gameTime.TotalGameTime;
|
||||
pixmap.LoadContent();
|
||||
sound.LoadContent();
|
||||
gameData.Read();
|
||||
inputPad.PixmapOrigin = pixmap.Origin;
|
||||
SetPhase(Def.Phase.Wait);
|
||||
return;
|
||||
}
|
||||
if (phase == Def.Phase.Wait)
|
||||
{
|
||||
if (continueMission == 2)
|
||||
{
|
||||
continueMission = 0;
|
||||
if (decor.CurrentRead())
|
||||
{
|
||||
SetPhase(Def.Phase.Resume);
|
||||
return;
|
||||
}
|
||||
}
|
||||
long num = gameTime.TotalGameTime.Ticks - startTime.Ticks;
|
||||
waitProgress = (double)num / 50000000.0;
|
||||
if (waitProgress > 1.0)
|
||||
{
|
||||
SetPhase(Def.Phase.Init);
|
||||
}
|
||||
return;
|
||||
}
|
||||
inputPad.Update();
|
||||
Def.ButtonGlyph buttonPressed = inputPad.ButtonPressed;
|
||||
if (buttonPressed >= Def.ButtonGlyph.InitGamerA && buttonPressed <= Def.ButtonGlyph.InitGamerC)
|
||||
{
|
||||
SetGamer((int)(buttonPressed - 1));
|
||||
return;
|
||||
}
|
||||
switch (buttonPressed)
|
||||
{
|
||||
case Def.ButtonGlyph.InitSetup:
|
||||
SetPhase(Def.Phase.MainSetup);
|
||||
return;
|
||||
case Def.ButtonGlyph.PauseSetup:
|
||||
SetPhase(Def.Phase.PlaySetup);
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupSounds:
|
||||
gameData.Sounds = !gameData.Sounds;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupJump:
|
||||
gameData.JumpRight = !gameData.JumpRight;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupZoom:
|
||||
gameData.AutoZoom = !gameData.AutoZoom;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupAccel:
|
||||
gameData.AccelActive = !gameData.AccelActive;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupReset:
|
||||
gameData.Reset();
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlyph.SetupReturn:
|
||||
if (playSetup)
|
||||
{
|
||||
SetPhase(Def.Phase.Play, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPhase(Def.Phase.Init);
|
||||
}
|
||||
return;
|
||||
case Def.ButtonGlyph.InitPlay:
|
||||
SetPhase(Def.Phase.Play, 1);
|
||||
return;
|
||||
case Def.ButtonGlyph.PlayPause:
|
||||
SetPhase(Def.Phase.Pause);
|
||||
return;
|
||||
case Def.ButtonGlyph.WinLostReturn:
|
||||
case Def.ButtonGlyph.PauseMenu:
|
||||
case Def.ButtonGlyph.ResumeMenu:
|
||||
SetPhase(Def.Phase.Init);
|
||||
break;
|
||||
}
|
||||
switch (buttonPressed)
|
||||
{
|
||||
case Def.ButtonGlyph.ResumeContinue:
|
||||
ContinueMission();
|
||||
return;
|
||||
case Def.ButtonGlyph.InitBuy:
|
||||
case Def.ButtonGlyph.TrialBuy:
|
||||
Guide.Show(PlayerIndex.One);
|
||||
SetPhase(Def.Phase.Init);
|
||||
return;
|
||||
case Def.ButtonGlyph.InitRanking:
|
||||
SetPhase(Def.Phase.Ranking);
|
||||
return;
|
||||
case Def.ButtonGlyph.TrialCancel:
|
||||
case Def.ButtonGlyph.RankingContinue:
|
||||
SetPhase(Def.Phase.Init);
|
||||
return;
|
||||
case Def.ButtonGlyph.PauseBack:
|
||||
MissionBack();
|
||||
return;
|
||||
case Def.ButtonGlyph.PauseRestart:
|
||||
SetPhase(Def.Phase.Play, mission);
|
||||
return;
|
||||
case Def.ButtonGlyph.PauseContinue:
|
||||
SetPhase(Def.Phase.Play, -1);
|
||||
return;
|
||||
case Def.ButtonGlyph.Cheat11:
|
||||
case Def.ButtonGlyph.Cheat12:
|
||||
case Def.ButtonGlyph.Cheat21:
|
||||
case Def.ButtonGlyph.Cheat22:
|
||||
case Def.ButtonGlyph.Cheat31:
|
||||
case Def.ButtonGlyph.Cheat32:
|
||||
if (buttonPressed == cheatGeste[cheatGesteIndex])
|
||||
{
|
||||
cheatGesteIndex++;
|
||||
if (cheatGesteIndex == cheatGeste.Length)
|
||||
{
|
||||
cheatGesteIndex = 0;
|
||||
inputPad.ShowCheatMenu = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cheatGesteIndex = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (buttonPressed != 0)
|
||||
{
|
||||
cheatGesteIndex = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (buttonPressed >= Def.ButtonGlyph.Cheat1 && buttonPressed <= Def.ButtonGlyph.Cheat9)
|
||||
{
|
||||
CheatAction(buttonPressed);
|
||||
}
|
||||
if (phase == Def.Phase.Play)
|
||||
{
|
||||
decor.ButtonPressed = buttonPressed;
|
||||
decor.MoveStep();
|
||||
int num2 = decor.IsTerminated();
|
||||
if (num2 == -1)
|
||||
{
|
||||
MemorizeGamerProgress();
|
||||
SetPhase(Def.Phase.Lost);
|
||||
}
|
||||
else if (num2 == -2)
|
||||
{
|
||||
MemorizeGamerProgress();
|
||||
SetPhase(Def.Phase.Win);
|
||||
}
|
||||
else if (num2 >= 1)
|
||||
{
|
||||
MemorizeGamerProgress();
|
||||
StartMission(num2);
|
||||
}
|
||||
}
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
private void MissionBack()
|
||||
{
|
||||
int num = mission;
|
||||
if (num == 1)
|
||||
{
|
||||
SetPhase(Def.Phase.Init);
|
||||
return;
|
||||
}
|
||||
num = ((num % 10 == 0) ? 1 : (num / 10 * 10));
|
||||
SetPhase(Def.Phase.Play, num);
|
||||
}
|
||||
|
||||
private void StartMission(int mission)
|
||||
{
|
||||
if (mission > 20 && mission % 10 > 1 && IsTrialMode)
|
||||
{
|
||||
SetPhase(Def.Phase.Trial);
|
||||
return;
|
||||
}
|
||||
this.mission = mission;
|
||||
if (this.mission != 1)
|
||||
{
|
||||
gameData.LastWorld = this.mission / 10;
|
||||
}
|
||||
decor.Read(0, this.mission, false);
|
||||
decor.LoadImages();
|
||||
decor.SetMission(this.mission);
|
||||
decor.SetNbVies(gameData.NbVies);
|
||||
decor.InitializeDoors(gameData);
|
||||
decor.AdaptDoors(false);
|
||||
decor.MainSwitchInitialize(gameData.LastWorld);
|
||||
decor.PlayPrepare(false);
|
||||
decor.StartSound();
|
||||
inputPad.StartMission(this.mission);
|
||||
}
|
||||
|
||||
private void ContinueMission()
|
||||
{
|
||||
SetPhase(Def.Phase.Play, -2);
|
||||
mission = decor.GetMission();
|
||||
if (mission != 1)
|
||||
{
|
||||
gameData.LastWorld = mission / 10;
|
||||
}
|
||||
decor.LoadImages();
|
||||
decor.StartSound();
|
||||
inputPad.StartMission(mission);
|
||||
}
|
||||
|
||||
private void CheatAction(Def.ButtonGlyph glyph)
|
||||
{
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlyph.Cheat1:
|
||||
decor.CheatAction(Tables.CheatCodes.OpenDoors);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat2:
|
||||
decor.CheatAction(Tables.CheatCodes.SuperBlupi);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat3:
|
||||
decor.CheatAction(Tables.CheatCodes.ShowSecret);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat4:
|
||||
decor.CheatAction(Tables.CheatCodes.LayEgg);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat5:
|
||||
gameData.Reset();
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat6:
|
||||
simulateTrialMode = !simulateTrialMode;
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat7:
|
||||
decor.CheatAction(Tables.CheatCodes.CleanAll);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat8:
|
||||
decor.CheatAction(Tables.CheatCodes.AllTreasure);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat9:
|
||||
decor.CheatAction(Tables.CheatCodes.EndGoal);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
if (continueMission == 1)
|
||||
{
|
||||
continueMission = 2;
|
||||
}
|
||||
if (phase == Def.Phase.Wait || phase == Def.Phase.Init || phase == Def.Phase.Pause || phase == Def.Phase.Resume || phase == Def.Phase.Lost || phase == Def.Phase.Win || phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup || phase == Def.Phase.Trial || phase == Def.Phase.Ranking)
|
||||
{
|
||||
pixmap.DrawBackground();
|
||||
if (fadeOutPhase == Def.Phase.None && missionToStart1 != -1)
|
||||
{
|
||||
missionToStart2 = missionToStart1;
|
||||
missionToStart1 = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawBackgroundFade();
|
||||
if (fadeOutPhase == Def.Phase.None)
|
||||
{
|
||||
DrawButtonsBackground();
|
||||
inputPad.Draw();
|
||||
DrawButtonsText();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (phase == Def.Phase.Play)
|
||||
{
|
||||
decor.Build();
|
||||
inputPad.Draw();
|
||||
}
|
||||
if (phase == Def.Phase.Wait)
|
||||
{
|
||||
DrawWaitProgress();
|
||||
}
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
|
||||
private void DrawBackgroundFade()
|
||||
{
|
||||
if (phase == Def.Phase.Init)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 20.0, 1.0);
|
||||
TinyRect rect;
|
||||
double opacity;
|
||||
if (fadeOutPhase == Def.Phase.MainSetup)
|
||||
{
|
||||
num = (1.0 - num) * (1.0 - num);
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = (int)(720.0 - 640.0 * num);
|
||||
tinyRect.RightX = (int)(1360.0 - 640.0 * num);
|
||||
tinyRect.TopY = 0;
|
||||
tinyRect.BottomY = 160;
|
||||
rect = tinyRect;
|
||||
opacity = num * num;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = ((fadeOutPhase != 0) ? (1.0 - num * 2.0) : (1.0 - (1.0 - num) * (1.0 - num)));
|
||||
TinyRect tinyRect2 = default(TinyRect);
|
||||
tinyRect2.LeftX = 80;
|
||||
tinyRect2.RightX = 720;
|
||||
tinyRect2.TopY = (int)(-160.0 + num * 160.0);
|
||||
tinyRect2.BottomY = (int)(0.0 + num * 160.0);
|
||||
rect = tinyRect2;
|
||||
opacity = 1.0;
|
||||
}
|
||||
pixmap.DrawIcon(15, 0, rect, opacity, false);
|
||||
}
|
||||
if (phase == Def.Phase.Init)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 20.0, 1.0);
|
||||
double opacity;
|
||||
if (fadeOutPhase == Def.Phase.MainSetup)
|
||||
{
|
||||
opacity = (1.0 - num) * (1.0 - num);
|
||||
num = 1.0;
|
||||
}
|
||||
else if (fadeOutPhase == Def.Phase.None)
|
||||
{
|
||||
num = 0.5 + num / 2.0;
|
||||
opacity = Math.Min(num * num, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
opacity = 1.0 - num;
|
||||
num = 1.0 + num * 10.0;
|
||||
}
|
||||
TinyRect tinyRect3 = default(TinyRect);
|
||||
tinyRect3.LeftX = (int)(468.0 - 205.0 * num);
|
||||
tinyRect3.RightX = (int)(468.0 + 205.0 * num);
|
||||
tinyRect3.TopY = (int)(280.0 - 190.0 * num);
|
||||
tinyRect3.BottomY = (int)(280.0 + 190.0 * num);
|
||||
TinyRect rect = tinyRect3;
|
||||
pixmap.DrawIcon(16, 0, rect, opacity, 0.0, false);
|
||||
}
|
||||
if (phase == Def.Phase.Pause || phase == Def.Phase.Resume)
|
||||
{
|
||||
if (fadeOutPhase == Def.Phase.Play)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 20.0, 1.0);
|
||||
double opacity = 1.0 - num;
|
||||
num = 1.0 + num * 10.0;
|
||||
TinyRect tinyRect4 = default(TinyRect);
|
||||
tinyRect4.LeftX = (int)(418.0 - 205.0 * num);
|
||||
tinyRect4.RightX = (int)(418.0 + 205.0 * num);
|
||||
tinyRect4.TopY = (int)(190.0 - 190.0 * num);
|
||||
tinyRect4.BottomY = (int)(190.0 + 190.0 * num);
|
||||
TinyRect rect = tinyRect4;
|
||||
pixmap.DrawIcon(16, 0, rect, opacity, 0.0, false);
|
||||
}
|
||||
else if (fadeOutPhase == Def.Phase.PlaySetup)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 20.0, 1.0);
|
||||
num *= num;
|
||||
TinyRect tinyRect5 = default(TinyRect);
|
||||
tinyRect5.LeftX = (int)(213.0 + 800.0 * num);
|
||||
tinyRect5.RightX = (int)(623.0 + 800.0 * num);
|
||||
tinyRect5.TopY = 0;
|
||||
tinyRect5.BottomY = 0;
|
||||
TinyRect rect = tinyRect5;
|
||||
pixmap.DrawIcon(16, 0, rect, 1.0, 0.0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
double num;
|
||||
if (fadeOutPhase == Def.Phase.None)
|
||||
{
|
||||
num = Math.Min((double)phaseTime / 15.0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = Math.Min((double)phaseTime / 15.0, 1.0);
|
||||
num = 1.0 - num;
|
||||
}
|
||||
TinyRect tinyRect6 = default(TinyRect);
|
||||
tinyRect6.LeftX = (int)(418.0 - 205.0 * num);
|
||||
tinyRect6.RightX = (int)(418.0 + 205.0 * num);
|
||||
tinyRect6.TopY = (int)(190.0 - 190.0 * num);
|
||||
tinyRect6.BottomY = (int)(190.0 + 190.0 * num);
|
||||
TinyRect rect = tinyRect6;
|
||||
double rotation = 0.0;
|
||||
if (num < 1.0)
|
||||
{
|
||||
rotation = (1.0 - num) * (1.0 - num) * 360.0 * 1.0;
|
||||
}
|
||||
if (rect.Width > 0 && rect.Height > 0)
|
||||
{
|
||||
pixmap.DrawIcon(16, 0, rect, 1.0, rotation, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 20.0, 1.0);
|
||||
num = 1.0 - (1.0 - num) * (1.0 - num);
|
||||
double num2;
|
||||
if (phaseTime < 20)
|
||||
{
|
||||
num2 = (double)phaseTime / 20.0;
|
||||
num2 = 1.0 - (1.0 - num2) * (1.0 - num2);
|
||||
}
|
||||
else
|
||||
{
|
||||
num2 = 1.0 + ((double)phaseTime - 20.0) / 400.0;
|
||||
}
|
||||
if (fadeOutPhase != 0)
|
||||
{
|
||||
num = 1.0 - num;
|
||||
num2 = 1.0 - num2;
|
||||
}
|
||||
TinyRect tinyRect7 = default(TinyRect);
|
||||
tinyRect7.LeftX = (int)(720.0 - 640.0 * num);
|
||||
tinyRect7.RightX = (int)(1360.0 - 640.0 * num);
|
||||
tinyRect7.TopY = 0;
|
||||
tinyRect7.BottomY = 160;
|
||||
TinyRect rect = tinyRect7;
|
||||
pixmap.DrawIcon(15, 0, rect, num * num, false);
|
||||
TinyRect tinyRect8 = default(TinyRect);
|
||||
tinyRect8.LeftX = 487;
|
||||
tinyRect8.RightX = 713;
|
||||
tinyRect8.TopY = 148;
|
||||
tinyRect8.BottomY = 374;
|
||||
TinyRect rect2 = tinyRect8;
|
||||
TinyRect tinyRect9 = default(TinyRect);
|
||||
tinyRect9.LeftX = 118;
|
||||
tinyRect9.RightX = 570;
|
||||
tinyRect9.TopY = 268;
|
||||
tinyRect9.BottomY = 720;
|
||||
TinyRect rect3 = tinyRect9;
|
||||
double opacity = 0.5 - num * 0.4;
|
||||
double rotation = (0.0 - num2) * 100.0 * 2.5;
|
||||
pixmap.DrawIcon(17, 0, rect2, opacity, rotation, false);
|
||||
pixmap.DrawIcon(17, 0, rect3, opacity, (0.0 - rotation) * 0.5, false);
|
||||
}
|
||||
if (phase == Def.Phase.Lost)
|
||||
{
|
||||
double num = Math.Min((double)phaseTime / 100.0, 1.0);
|
||||
TinyRect tinyRect10 = default(TinyRect);
|
||||
tinyRect10.LeftX = (int)(418.0 - 205.0 * num);
|
||||
tinyRect10.RightX = (int)(418.0 + 205.0 * num);
|
||||
tinyRect10.TopY = (int)(238.0 - 190.0 * num);
|
||||
tinyRect10.BottomY = (int)(238.0 + 190.0 * num);
|
||||
TinyRect rect = tinyRect10;
|
||||
double rotation = 0.0;
|
||||
if (num < 1.0)
|
||||
{
|
||||
rotation = (1.0 - num) * (1.0 - num) * 360.0 * 6.0;
|
||||
}
|
||||
if (rect.Width > 0 && rect.Height > 0)
|
||||
{
|
||||
pixmap.DrawIcon(16, 0, rect, 1.0, rotation, false);
|
||||
}
|
||||
}
|
||||
if (phase == Def.Phase.Win)
|
||||
{
|
||||
double num = Math.Sin((double)phaseTime / 3.0) / 2.0 + 1.0;
|
||||
TinyRect tinyRect11 = default(TinyRect);
|
||||
tinyRect11.LeftX = (int)(418.0 - 205.0 * num);
|
||||
tinyRect11.RightX = (int)(418.0 + 205.0 * num);
|
||||
tinyRect11.TopY = (int)(238.0 - 190.0 * num);
|
||||
tinyRect11.BottomY = (int)(238.0 + 190.0 * num);
|
||||
TinyRect rect = tinyRect11;
|
||||
pixmap.DrawIcon(16, 0, rect, 1.0, 0.0, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonsBackground()
|
||||
{
|
||||
if (phase == Def.Phase.Init)
|
||||
{
|
||||
TinyRect drawBounds = pixmap.DrawBounds;
|
||||
int width = drawBounds.Width;
|
||||
int height = drawBounds.Height;
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = 10;
|
||||
tinyRect.RightX = 260;
|
||||
tinyRect.TopY = height - 325;
|
||||
tinyRect.BottomY = height - 10;
|
||||
TinyRect rect = tinyRect;
|
||||
pixmap.DrawIcon(14, 15, rect, 0.3, false);
|
||||
TinyRect tinyRect2 = default(TinyRect);
|
||||
tinyRect2.LeftX = width - 170;
|
||||
tinyRect2.RightX = width - 10;
|
||||
tinyRect2.TopY = height - ((IsTrialMode || IsRankingMode) ? 325 : 195);
|
||||
tinyRect2.BottomY = height - 10;
|
||||
rect = tinyRect2;
|
||||
pixmap.DrawIcon(14, 15, rect, 0.3, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonsText()
|
||||
{
|
||||
if (phase == Def.Phase.Init)
|
||||
{
|
||||
DrawButtonGamerText(Def.ButtonGlyph.InitGamerA, 0);
|
||||
DrawButtonGamerText(Def.ButtonGlyph.InitGamerB, 1);
|
||||
DrawButtonGamerText(Def.ButtonGlyph.InitGamerC, 2);
|
||||
DrawTextUnderButton(Def.ButtonGlyph.InitPlay, MyResource.TX_BUTTON_PLAY);
|
||||
DrawTextRightButton(Def.ButtonGlyph.InitSetup, MyResource.TX_BUTTON_SETUP);
|
||||
if (IsTrialMode)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.InitBuy, MyResource.TX_BUTTON_BUY);
|
||||
}
|
||||
if (IsRankingMode)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.InitRanking, MyResource.TX_BUTTON_RANKING);
|
||||
}
|
||||
}
|
||||
if (phase == Def.Phase.Pause)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.PauseMenu, MyResource.TX_BUTTON_MENU);
|
||||
if (mission != 1)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.PauseBack, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
DrawTextUnderButton(Def.ButtonGlyph.PauseSetup, MyResource.TX_BUTTON_SETUP);
|
||||
if (mission != 1 && mission % 10 != 0)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.PauseRestart, MyResource.TX_BUTTON_RESTART);
|
||||
}
|
||||
DrawTextUnderButton(Def.ButtonGlyph.PauseContinue, MyResource.TX_BUTTON_CONTINUE);
|
||||
}
|
||||
if (phase == Def.Phase.Resume)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.ResumeMenu, MyResource.TX_BUTTON_MENU);
|
||||
DrawTextUnderButton(Def.ButtonGlyph.ResumeContinue, MyResource.TX_BUTTON_CONTINUE);
|
||||
}
|
||||
if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup)
|
||||
{
|
||||
DrawTextRightButton(Def.ButtonGlyph.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS);
|
||||
DrawTextRightButton(Def.ButtonGlyph.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP);
|
||||
DrawTextRightButton(Def.ButtonGlyph.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM);
|
||||
DrawTextRightButton(Def.ButtonGlyph.SetupAccel, MyResource.TX_BUTTON_SETUP_ACCEL);
|
||||
if (phase == Def.Phase.MainSetup)
|
||||
{
|
||||
string text = string.Format(MyResource.LoadString(MyResource.TX_BUTTON_SETUP_RESET), new string((char)(65 + gameData.SelectedGamer), 1));
|
||||
DrawTextRightButton(Def.ButtonGlyph.SetupReset, text);
|
||||
}
|
||||
}
|
||||
if (phase == Def.Phase.Trial)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = 360;
|
||||
tinyPoint.Y = 50;
|
||||
TinyPoint pos = tinyPoint;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL1), 0.9);
|
||||
pos.Y += 40;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL2), 0.7);
|
||||
pos.Y += 25;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL3), 0.7);
|
||||
pos.Y += 25;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL4), 0.7);
|
||||
pos.Y += 25;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL5), 0.7);
|
||||
pos.Y += 25;
|
||||
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL6), 0.7);
|
||||
DrawTextUnderButton(Def.ButtonGlyph.TrialBuy, MyResource.TX_BUTTON_BUY);
|
||||
DrawTextUnderButton(Def.ButtonGlyph.TrialCancel, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
if (phase == Def.Phase.Ranking)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlyph.RankingContinue, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonGamerText(Def.ButtonGlyph glyph, int gamer)
|
||||
{
|
||||
TinyRect buttonRect = inputPad.GetButtonRect(glyph);
|
||||
int nbVies;
|
||||
int mainDoors;
|
||||
int secondaryDoors;
|
||||
gameData.GetGamerInfo(gamer, out nbVies, out mainDoors, out secondaryDoors);
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = buttonRect.RightX + 5 - pixmap.Origin.X;
|
||||
tinyPoint.Y = buttonRect.TopY + 3 - pixmap.Origin.Y;
|
||||
TinyPoint pos = tinyPoint;
|
||||
string text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_TITLE), new string((char)(65 + gamer), 1));
|
||||
Text.DrawText(pixmap, pos, text, 0.7);
|
||||
TinyPoint tinyPoint2 = default(TinyPoint);
|
||||
tinyPoint2.X = buttonRect.RightX + 5 - pixmap.Origin.X;
|
||||
tinyPoint2.Y = buttonRect.TopY + 25 - pixmap.Origin.Y;
|
||||
pos = tinyPoint2;
|
||||
text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_MDOORS), mainDoors);
|
||||
Text.DrawText(pixmap, pos, text, 0.45);
|
||||
TinyPoint tinyPoint3 = default(TinyPoint);
|
||||
tinyPoint3.X = buttonRect.RightX + 5 - pixmap.Origin.X;
|
||||
tinyPoint3.Y = buttonRect.TopY + 39 - pixmap.Origin.Y;
|
||||
pos = tinyPoint3;
|
||||
text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_SDOORS), secondaryDoors);
|
||||
Text.DrawText(pixmap, pos, text, 0.45);
|
||||
TinyPoint tinyPoint4 = default(TinyPoint);
|
||||
tinyPoint4.X = buttonRect.RightX + 5 - pixmap.Origin.X;
|
||||
tinyPoint4.Y = buttonRect.TopY + 53 - pixmap.Origin.Y;
|
||||
pos = tinyPoint4;
|
||||
text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_LIFES), nbVies);
|
||||
Text.DrawText(pixmap, pos, text, 0.45);
|
||||
}
|
||||
|
||||
private void DrawTextRightButton(Def.ButtonGlyph glyph, int res)
|
||||
{
|
||||
DrawTextRightButton(glyph, MyResource.LoadString(res));
|
||||
}
|
||||
|
||||
private void DrawTextRightButton(Def.ButtonGlyph glyph, string text)
|
||||
{
|
||||
TinyRect buttonRect = inputPad.GetButtonRect(glyph);
|
||||
string[] array = text.Split('\n');
|
||||
if (array.Length == 2)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = buttonRect.RightX + 10 - pixmap.Origin.X;
|
||||
tinyPoint.Y = (buttonRect.TopY + buttonRect.BottomY) / 2 - 20 - pixmap.Origin.Y;
|
||||
TinyPoint pos = tinyPoint;
|
||||
Text.DrawText(pixmap, pos, array[0], 0.7);
|
||||
pos.Y += 24;
|
||||
Text.DrawText(pixmap, pos, array[1], 0.7);
|
||||
}
|
||||
else
|
||||
{
|
||||
TinyPoint tinyPoint2 = default(TinyPoint);
|
||||
tinyPoint2.X = buttonRect.RightX + 10 - pixmap.Origin.X;
|
||||
tinyPoint2.Y = (buttonRect.TopY + buttonRect.BottomY) / 2 - 8 - pixmap.Origin.Y;
|
||||
TinyPoint pos2 = tinyPoint2;
|
||||
Text.DrawText(pixmap, pos2, text, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawTextUnderButton(Def.ButtonGlyph glyph, int res)
|
||||
{
|
||||
TinyRect buttonRect = inputPad.GetButtonRect(glyph);
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = (buttonRect.LeftX + buttonRect.RightX) / 2 - pixmap.Origin.X;
|
||||
tinyPoint.Y = buttonRect.BottomY + 2 - pixmap.Origin.Y;
|
||||
TinyPoint pos = tinyPoint;
|
||||
string text = MyResource.LoadString(res);
|
||||
Text.DrawTextCenter(pixmap, pos, text, 0.7);
|
||||
}
|
||||
|
||||
private void DrawWaitProgress()
|
||||
{
|
||||
if (continueMission != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < waitTable.Length; i++)
|
||||
{
|
||||
if (waitProgress <= waitTable[i * 2])
|
||||
{
|
||||
waitJauge.SetLevel((int)waitTable[i * 2 + 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
waitJauge.Draw();
|
||||
}
|
||||
|
||||
private void DrawDebug()
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = 10;
|
||||
tinyPoint.Y = 20;
|
||||
TinyPoint pos = tinyPoint;
|
||||
Text.DrawText(pixmap, pos, inputPad.TotalTouch.ToString(), 1.0);
|
||||
}
|
||||
|
||||
private void SetGamer(int gamer)
|
||||
{
|
||||
gameData.SelectedGamer = gamer;
|
||||
gameData.Write();
|
||||
}
|
||||
|
||||
private void SetPhase(Def.Phase phase)
|
||||
{
|
||||
SetPhase(phase, 0);
|
||||
}
|
||||
|
||||
private void SetPhase(Def.Phase phase, int mission)
|
||||
{
|
||||
if (mission != -2)
|
||||
{
|
||||
if (missionToStart2 == -1)
|
||||
{
|
||||
if ((this.phase == Def.Phase.Init || this.phase == Def.Phase.MainSetup || this.phase == Def.Phase.PlaySetup || this.phase == Def.Phase.Pause || this.phase == Def.Phase.Resume) && fadeOutPhase == Def.Phase.None)
|
||||
{
|
||||
fadeOutPhase = phase;
|
||||
fadeOutMission = mission;
|
||||
phaseTime = 0;
|
||||
return;
|
||||
}
|
||||
if (phase == Def.Phase.Play)
|
||||
{
|
||||
fadeOutPhase = Def.Phase.None;
|
||||
if (fadeOutMission != -1)
|
||||
{
|
||||
missionToStart1 = fadeOutMission;
|
||||
return;
|
||||
}
|
||||
mission = fadeOutMission;
|
||||
decor.LoadImages();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mission = missionToStart2;
|
||||
}
|
||||
}
|
||||
this.phase = phase;
|
||||
fadeOutPhase = Def.Phase.None;
|
||||
inputPad.Phase = this.phase;
|
||||
playSetup = this.phase == Def.Phase.PlaySetup;
|
||||
isTrialMode = Guide.IsTrialMode;
|
||||
phaseTime = 0;
|
||||
missionToStart2 = -1;
|
||||
decor.StopSound();
|
||||
switch (this.phase)
|
||||
{
|
||||
case Def.Phase.Init:
|
||||
pixmap.BackgroundCache("init");
|
||||
break;
|
||||
case Def.Phase.Pause:
|
||||
case Def.Phase.Resume:
|
||||
pixmap.BackgroundCache("pause");
|
||||
break;
|
||||
case Def.Phase.Lost:
|
||||
pixmap.BackgroundCache("lost");
|
||||
break;
|
||||
case Def.Phase.Win:
|
||||
pixmap.BackgroundCache("win");
|
||||
break;
|
||||
case Def.Phase.MainSetup:
|
||||
case Def.Phase.PlaySetup:
|
||||
pixmap.BackgroundCache("setup");
|
||||
break;
|
||||
case Def.Phase.Trial:
|
||||
pixmap.BackgroundCache("trial");
|
||||
break;
|
||||
case Def.Phase.Ranking:
|
||||
pixmap.BackgroundCache("pause");
|
||||
break;
|
||||
case Def.Phase.Play:
|
||||
decor.DrawBounds = pixmap.DrawBounds;
|
||||
break;
|
||||
}
|
||||
if (this.phase == Def.Phase.Play && mission > 0)
|
||||
{
|
||||
StartMission(mission);
|
||||
}
|
||||
}
|
||||
|
||||
private void MemorizeGamerProgress()
|
||||
{
|
||||
gameData.NbVies = decor.GetNbVies();
|
||||
decor.MemorizeDoors(gameData);
|
||||
gameData.Write();
|
||||
}
|
||||
|
||||
public void ToggleFullScreen()
|
||||
{
|
||||
this.graphics.ToggleFullScreen();
|
||||
}
|
||||
public bool IsFullScreen() { return this.graphics.IsFullScreen; }
|
||||
|
||||
public GraphicsDeviceManager getGraphics()
|
||||
{
|
||||
return graphics;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,220 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.GameData
|
||||
using System;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
|
||||
public class GameData
|
||||
{
|
||||
private static readonly int HeaderLength = 10;
|
||||
|
||||
private static readonly int DoorsLength = 200;
|
||||
|
||||
private static readonly int GamerLength = 10 + DoorsLength;
|
||||
|
||||
private static readonly int MaxGamer = 3;
|
||||
|
||||
private static readonly int TotalLength = HeaderLength + GamerLength * MaxGamer;
|
||||
|
||||
private readonly byte[] data;
|
||||
|
||||
public int SelectedGamer
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[2];
|
||||
}
|
||||
set
|
||||
{
|
||||
data[2] = (byte)value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Sounds
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[3] == 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
data[3] = (byte)(value ? 1u : 0u);
|
||||
}
|
||||
}
|
||||
|
||||
public bool JumpRight
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[4] == 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
data[4] = (byte)(value ? 1u : 0u);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AutoZoom
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[5] == 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
data[5] = (byte)(value ? 1u : 0u);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AccelActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[6] == 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
data[6] = (byte)(value ? 1u : 0u);
|
||||
}
|
||||
}
|
||||
|
||||
public double AccelSensitivity
|
||||
{
|
||||
get
|
||||
{
|
||||
return (double)(int)data[7] / 100.0;
|
||||
}
|
||||
set
|
||||
{
|
||||
value = Math.Max(value, 0.0);
|
||||
value = Math.Min(value, 1.0);
|
||||
data[7] = (byte)(value * 100.0);
|
||||
}
|
||||
}
|
||||
|
||||
public int NbVies
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[GamerOffset];
|
||||
}
|
||||
set
|
||||
{
|
||||
data[GamerOffset] = (byte)value;
|
||||
}
|
||||
}
|
||||
|
||||
public int LastWorld
|
||||
{
|
||||
get
|
||||
{
|
||||
return data[GamerOffset + 1];
|
||||
}
|
||||
set
|
||||
{
|
||||
data[GamerOffset + 1] = (byte)value;
|
||||
}
|
||||
}
|
||||
|
||||
private int GamerOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetGamerOffset(SelectedGamer);
|
||||
}
|
||||
}
|
||||
|
||||
public GameData()
|
||||
{
|
||||
data = new byte[TotalLength];
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void Read()
|
||||
{
|
||||
Worlds.ReadGameData(data);
|
||||
}
|
||||
|
||||
public void Write()
|
||||
{
|
||||
Worlds.WriteGameData(data);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Initialize(SelectedGamer);
|
||||
}
|
||||
|
||||
public void GetDoors(int[] doors)
|
||||
{
|
||||
for (int i = 0; i < DoorsLength; i++)
|
||||
{
|
||||
doors[i] = data[GamerOffset + 10 + i];
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDoors(int[] doors)
|
||||
{
|
||||
for (int i = 0; i < DoorsLength; i++)
|
||||
{
|
||||
data[GamerOffset + 10 + i] = (byte)doors[i];
|
||||
}
|
||||
}
|
||||
|
||||
public void GetGamerInfo(int gamer, out int nbVies, out int mainDoors, out int secondaryDoors)
|
||||
{
|
||||
nbVies = data[GetGamerOffset(gamer)];
|
||||
secondaryDoors = 0;
|
||||
for (int i = 0; i < 180; i++)
|
||||
{
|
||||
if (data[GetGamerOffset(gamer) + 10 + i] == 1)
|
||||
{
|
||||
secondaryDoors++;
|
||||
}
|
||||
}
|
||||
mainDoors = 0;
|
||||
for (int j = 180; j < 200; j++)
|
||||
{
|
||||
if (data[GetGamerOffset(gamer) + 10 + j] == 1)
|
||||
{
|
||||
mainDoors++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
data[0] = 1;
|
||||
data[1] = 1;
|
||||
data[2] = 0;
|
||||
data[3] = 1;
|
||||
data[4] = 1;
|
||||
data[5] = 1;
|
||||
data[6] = 0;
|
||||
data[7] = 50;
|
||||
SelectedGamer = 0;
|
||||
for (int i = 0; i < MaxGamer; i++)
|
||||
{
|
||||
Initialize(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void Initialize(int gamer)
|
||||
{
|
||||
data[GetGamerOffset(gamer)] = 3;
|
||||
data[GetGamerOffset(gamer) + 1] = 1;
|
||||
for (int i = 0; i < DoorsLength; i++)
|
||||
{
|
||||
data[GetGamerOffset(gamer) + 10 + i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private int GetGamerOffset(int gamer)
|
||||
{
|
||||
return HeaderLength + GamerLength * gamer;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,994 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.InputPad
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.Devices.Sensors;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Input.Touch;
|
||||
using static WindowsPhoneSpeedyBlupi.Xna;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class InputPad
|
||||
{
|
||||
private static readonly int padRadius = 140;
|
||||
|
||||
private readonly Game1 game1;
|
||||
|
||||
private readonly Decor decor;
|
||||
|
||||
private readonly Pixmap pixmap;
|
||||
|
||||
private readonly Sound sound;
|
||||
|
||||
private readonly GameData gameData;
|
||||
|
||||
private readonly List<Def.ButtonGlyph> pressedGlyphs;
|
||||
|
||||
private readonly Accelerometer accelSensor;
|
||||
|
||||
private readonly Slider accelSlider;
|
||||
|
||||
private bool padPressed;
|
||||
|
||||
private bool showCheatMenu;
|
||||
|
||||
private TinyPoint padTouchPos;
|
||||
|
||||
private Def.ButtonGlyph lastButtonDown;
|
||||
|
||||
private Def.ButtonGlyph buttonPressed;
|
||||
|
||||
private int touchCount;
|
||||
|
||||
private bool accelStarted;
|
||||
|
||||
private bool accelActive;
|
||||
|
||||
private double accelSpeedX;
|
||||
|
||||
private bool accelLastState;
|
||||
|
||||
private bool accelWaitZero;
|
||||
|
||||
private int mission;
|
||||
|
||||
public Def.Phase Phase { get; set; }
|
||||
|
||||
public int SelectedGamer { get; set; }
|
||||
|
||||
public TinyPoint PixmapOrigin { get; set; }
|
||||
|
||||
public int TotalTouch
|
||||
{
|
||||
get
|
||||
{
|
||||
return touchCount;
|
||||
}
|
||||
}
|
||||
|
||||
public Def.ButtonGlyph ButtonPressed
|
||||
{
|
||||
get
|
||||
{
|
||||
Def.ButtonGlyph result = buttonPressed;
|
||||
buttonPressed = Def.ButtonGlyph.None;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowCheatMenu
|
||||
{
|
||||
get
|
||||
{
|
||||
return showCheatMenu;
|
||||
}
|
||||
set
|
||||
{
|
||||
showCheatMenu = value;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<Def.ButtonGlyph> ButtonGlyphs
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case Def.Phase.Init:
|
||||
yield return Def.ButtonGlyph.InitGamerA;
|
||||
yield return Def.ButtonGlyph.InitGamerB;
|
||||
yield return Def.ButtonGlyph.InitGamerC;
|
||||
yield return Def.ButtonGlyph.InitSetup;
|
||||
yield return Def.ButtonGlyph.InitPlay;
|
||||
if (game1.IsTrialMode)
|
||||
{
|
||||
yield return Def.ButtonGlyph.InitBuy;
|
||||
}
|
||||
if (game1.IsRankingMode)
|
||||
{
|
||||
yield return Def.ButtonGlyph.InitRanking;
|
||||
}
|
||||
break;
|
||||
case Def.Phase.Play:
|
||||
yield return Def.ButtonGlyph.PlayPause;
|
||||
yield return Def.ButtonGlyph.PlayAction;
|
||||
yield return Def.ButtonGlyph.PlayJump;
|
||||
if (accelStarted)
|
||||
{
|
||||
yield return Def.ButtonGlyph.PlayDown;
|
||||
}
|
||||
yield return Def.ButtonGlyph.Cheat11;
|
||||
yield return Def.ButtonGlyph.Cheat12;
|
||||
yield return Def.ButtonGlyph.Cheat21;
|
||||
yield return Def.ButtonGlyph.Cheat22;
|
||||
yield return Def.ButtonGlyph.Cheat31;
|
||||
yield return Def.ButtonGlyph.Cheat32;
|
||||
break;
|
||||
case Def.Phase.Pause:
|
||||
yield return Def.ButtonGlyph.PauseMenu;
|
||||
if (mission != 1)
|
||||
{
|
||||
yield return Def.ButtonGlyph.PauseBack;
|
||||
}
|
||||
yield return Def.ButtonGlyph.PauseSetup;
|
||||
if (mission != 1 && mission % 10 != 0)
|
||||
{
|
||||
yield return Def.ButtonGlyph.PauseRestart;
|
||||
}
|
||||
yield return Def.ButtonGlyph.PauseContinue;
|
||||
break;
|
||||
case Def.Phase.Resume:
|
||||
yield return Def.ButtonGlyph.ResumeMenu;
|
||||
yield return Def.ButtonGlyph.ResumeContinue;
|
||||
break;
|
||||
case Def.Phase.Lost:
|
||||
case Def.Phase.Win:
|
||||
yield return Def.ButtonGlyph.WinLostReturn;
|
||||
break;
|
||||
case Def.Phase.Trial:
|
||||
yield return Def.ButtonGlyph.TrialBuy;
|
||||
yield return Def.ButtonGlyph.TrialCancel;
|
||||
break;
|
||||
case Def.Phase.MainSetup:
|
||||
yield return Def.ButtonGlyph.SetupSounds;
|
||||
yield return Def.ButtonGlyph.SetupJump;
|
||||
yield return Def.ButtonGlyph.SetupZoom;
|
||||
yield return Def.ButtonGlyph.SetupAccel;
|
||||
yield return Def.ButtonGlyph.SetupReset;
|
||||
yield return Def.ButtonGlyph.SetupReturn;
|
||||
break;
|
||||
case Def.Phase.PlaySetup:
|
||||
yield return Def.ButtonGlyph.SetupSounds;
|
||||
yield return Def.ButtonGlyph.SetupJump;
|
||||
yield return Def.ButtonGlyph.SetupZoom;
|
||||
yield return Def.ButtonGlyph.SetupAccel;
|
||||
yield return Def.ButtonGlyph.SetupReturn;
|
||||
break;
|
||||
case Def.Phase.Ranking:
|
||||
yield return Def.ButtonGlyph.RankingContinue;
|
||||
break;
|
||||
}
|
||||
if (showCheatMenu)
|
||||
{
|
||||
yield return Def.ButtonGlyph.Cheat1;
|
||||
yield return Def.ButtonGlyph.Cheat2;
|
||||
yield return Def.ButtonGlyph.Cheat3;
|
||||
yield return Def.ButtonGlyph.Cheat4;
|
||||
yield return Def.ButtonGlyph.Cheat5;
|
||||
yield return Def.ButtonGlyph.Cheat6;
|
||||
yield return Def.ButtonGlyph.Cheat7;
|
||||
yield return Def.ButtonGlyph.Cheat8;
|
||||
yield return Def.ButtonGlyph.Cheat9;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the point of the cente of the pad on the screen.
|
||||
/// </summary>
|
||||
private TinyPoint PadCenter
|
||||
{
|
||||
get
|
||||
{
|
||||
TinyRect drawBounds = pixmap.DrawBounds;
|
||||
int x = gameData.JumpRight ? 100 : drawBounds.Width - 100;
|
||||
return new TinyPoint(x, drawBounds.Height - 100);
|
||||
}
|
||||
}
|
||||
|
||||
public InputPad(Game1 game1, Decor decor, Pixmap pixmap, Sound sound, GameData gameData)
|
||||
{
|
||||
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0041: Expected O, but got Unknown
|
||||
this.game1 = game1;
|
||||
this.decor = decor;
|
||||
this.pixmap = pixmap;
|
||||
this.sound = sound;
|
||||
this.gameData = gameData;
|
||||
pressedGlyphs = new List<Def.ButtonGlyph>();
|
||||
accelSensor = new Accelerometer();
|
||||
((SensorBase<AccelerometerReading>)(object)accelSensor).CurrentValueChanged += HandleAccelSensorCurrentValueChanged;
|
||||
accelSlider = new Slider(new TinyPoint(320, 400), this.gameData.AccelSensitivity);
|
||||
lastButtonDown = Def.ButtonGlyph.None;
|
||||
buttonPressed = Def.ButtonGlyph.None;
|
||||
}
|
||||
|
||||
public void StartMission(int mission)
|
||||
{
|
||||
this.mission = mission;
|
||||
accelWaitZero = true;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
pressedGlyphs.Clear();
|
||||
if (accelActive != gameData.AccelActive)
|
||||
{
|
||||
accelActive = gameData.AccelActive;
|
||||
if (accelActive)
|
||||
{
|
||||
StartAccel();
|
||||
}
|
||||
else
|
||||
{
|
||||
StopAccel();
|
||||
}
|
||||
}
|
||||
double horizontalChange = 0.0;
|
||||
double verticalChange = 0.0;
|
||||
int keyPress = 0;
|
||||
padPressed = false;
|
||||
Def.ButtonGlyph buttonGlyph = Def.ButtonGlyph.None;
|
||||
TouchCollection touches = TouchPanel.GetState();
|
||||
touchCount = touches.Count;
|
||||
List<TinyPoint> touchesOrClicks = new List<TinyPoint>();
|
||||
foreach (TouchLocation item in touches)
|
||||
{
|
||||
if (item.State == TouchLocationState.Pressed || item.State == TouchLocationState.Moved)
|
||||
{
|
||||
TinyPoint touchPress = new TinyPoint((int)item.Position.X, (int)item.Position.Y);
|
||||
touchesOrClicks.Add(touchPress);
|
||||
}
|
||||
}
|
||||
|
||||
MouseState mouseState = Mouse.GetState();
|
||||
if (mouseState.LeftButton == ButtonState.Pressed)
|
||||
{
|
||||
touchCount++;
|
||||
TinyPoint mouseClick = new TinyPoint(mouseState.X, mouseState.Y);
|
||||
touchesOrClicks.Add(mouseClick);
|
||||
}
|
||||
|
||||
float screenWidth = game1.getGraphics().GraphicsDevice.Viewport.Width;
|
||||
float screenHeight = game1.getGraphics().GraphicsDevice.Viewport.Height;
|
||||
float screenRatio = screenWidth / screenHeight;
|
||||
|
||||
if (Env.PLATFORM == Platform.Android &&screenRatio > 1.3333333333333333)
|
||||
{
|
||||
for (int i = 0; i < touchesOrClicks.Count; i++)
|
||||
{
|
||||
|
||||
var touchOrClick = touchesOrClicks[i];
|
||||
if (touchOrClick.X == -1) continue;
|
||||
|
||||
float originalX = touchOrClick.X;
|
||||
float originalY = touchOrClick.Y;
|
||||
|
||||
float widthHeightRatio = screenWidth / screenHeight;
|
||||
float heightRatio = 480 / screenHeight;
|
||||
float widthRatio = 640 / screenWidth;
|
||||
if(Env.DETAILED_DEBUGGING)
|
||||
{
|
||||
Debug.WriteLine("-----");
|
||||
Debug.WriteLine("originalX=" + originalX);
|
||||
Debug.WriteLine("originalY=" + originalY);
|
||||
Debug.WriteLine("heightRatio=" + heightRatio);
|
||||
Debug.WriteLine("widthRatio=" + widthRatio);
|
||||
Debug.WriteLine("widthHeightRatio=" + widthHeightRatio);
|
||||
}
|
||||
if (screenHeight> 480) {
|
||||
touchOrClick.X = (int)(originalX * heightRatio);
|
||||
touchOrClick.Y = (int)(originalY * heightRatio);
|
||||
touchesOrClicks[i] = touchOrClick;
|
||||
}
|
||||
|
||||
if(Env.DETAILED_DEBUGGING) Debug.WriteLine("new X" + touchOrClick.X);
|
||||
if(Env.DETAILED_DEBUGGING) Debug.WriteLine("new Y" + touchOrClick.Y);
|
||||
}
|
||||
}
|
||||
|
||||
KeyboardState newKeyboardState = Keyboard.GetState();
|
||||
Keys[] keysToBeChecked = new Keys[6] { Keys.LeftControl, Keys.Up, Keys.Right, Keys.Down, Keys.Left, Keys.Space };
|
||||
foreach(Keys keys in keysToBeChecked) {
|
||||
if (newKeyboardState.IsKeyDown(keys)) touchesOrClicks.Add(new TinyPoint(-1, (int)keys));
|
||||
}
|
||||
if (newKeyboardState.IsKeyDown(Keys.F11))
|
||||
{
|
||||
game1.ToggleFullScreen ();
|
||||
Debug.WriteLine("F11 was pressed.");
|
||||
}
|
||||
|
||||
Boolean keyPressedUp = false;
|
||||
Boolean keyPressedDown = false;
|
||||
Boolean keyPressedLeft = false;
|
||||
Boolean keyPressedRight = false;
|
||||
foreach (TinyPoint touchOrClickItem in touchesOrClicks)
|
||||
{
|
||||
Boolean keyboardPressed = false;
|
||||
if (touchOrClickItem.X == -1)
|
||||
{
|
||||
keyboardPressed = true;
|
||||
}
|
||||
Keys keyPressed = keyboardPressed ? (Keys)touchOrClickItem.Y : Keys.None;
|
||||
keyPressedUp = keyPressed == Keys.Up ? true : keyPressedUp;
|
||||
keyPressedDown = keyPressed == Keys.Down ? true : keyPressedDown;
|
||||
keyPressedLeft = keyPressed == Keys.Left ? true : keyPressedLeft;
|
||||
keyPressedRight = keyPressed == Keys.Right ? true : keyPressedRight;
|
||||
|
||||
{
|
||||
TinyPoint touchOrClick = keyboardPressed ? new TinyPoint(1, 1) : touchOrClickItem;
|
||||
if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padRadius), touchOrClick))
|
||||
{
|
||||
padPressed = true;
|
||||
padTouchPos = touchOrClick;
|
||||
}
|
||||
if (keyPressedUp || keyPressedDown || keyPressedLeft || keyPressedRight)
|
||||
{
|
||||
padPressed = true;
|
||||
}
|
||||
Debug.WriteLine("padPressed=" + padPressed);
|
||||
Def.ButtonGlyph pressedGlyph = ButtonDetect(touchOrClick);
|
||||
Debug.WriteLine("buttonGlyph2 =" + pressedGlyph);
|
||||
if (pressedGlyph != 0)
|
||||
{
|
||||
pressedGlyphs.Add(pressedGlyph);
|
||||
}
|
||||
if (keyboardPressed)
|
||||
{
|
||||
switch (keyPressed)
|
||||
{
|
||||
case Keys.LeftControl: pressedGlyph = Def.ButtonGlyph.PlayJump; pressedGlyphs.Add(pressedGlyph); break;
|
||||
case Keys.Space: pressedGlyph = Def.ButtonGlyph.PlayAction; pressedGlyphs.Add(pressedGlyph); break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(touchOrClick))
|
||||
{
|
||||
gameData.AccelSensitivity = accelSlider.Value;
|
||||
}
|
||||
switch (pressedGlyph)
|
||||
{
|
||||
case Def.ButtonGlyph.PlayJump:
|
||||
Debug.WriteLine("Jumping detected");
|
||||
accelWaitZero = false;
|
||||
keyPress |= 1;
|
||||
break;
|
||||
case Def.ButtonGlyph.PlayDown:
|
||||
accelWaitZero = false;
|
||||
keyPress |= 4;
|
||||
break;
|
||||
case Def.ButtonGlyph.InitGamerA:
|
||||
case Def.ButtonGlyph.InitGamerB:
|
||||
case Def.ButtonGlyph.InitGamerC:
|
||||
case Def.ButtonGlyph.InitSetup:
|
||||
case Def.ButtonGlyph.InitPlay:
|
||||
case Def.ButtonGlyph.InitBuy:
|
||||
case Def.ButtonGlyph.InitRanking:
|
||||
case Def.ButtonGlyph.WinLostReturn:
|
||||
case Def.ButtonGlyph.TrialBuy:
|
||||
case Def.ButtonGlyph.TrialCancel:
|
||||
case Def.ButtonGlyph.SetupSounds:
|
||||
case Def.ButtonGlyph.SetupJump:
|
||||
case Def.ButtonGlyph.SetupZoom:
|
||||
case Def.ButtonGlyph.SetupAccel:
|
||||
case Def.ButtonGlyph.SetupReset:
|
||||
case Def.ButtonGlyph.SetupReturn:
|
||||
case Def.ButtonGlyph.PauseMenu:
|
||||
case Def.ButtonGlyph.PauseBack:
|
||||
case Def.ButtonGlyph.PauseSetup:
|
||||
case Def.ButtonGlyph.PauseRestart:
|
||||
case Def.ButtonGlyph.PauseContinue:
|
||||
case Def.ButtonGlyph.PlayPause:
|
||||
case Def.ButtonGlyph.PlayAction:
|
||||
case Def.ButtonGlyph.ResumeMenu:
|
||||
case Def.ButtonGlyph.ResumeContinue:
|
||||
case Def.ButtonGlyph.RankingContinue:
|
||||
case Def.ButtonGlyph.Cheat11:
|
||||
case Def.ButtonGlyph.Cheat12:
|
||||
case Def.ButtonGlyph.Cheat21:
|
||||
case Def.ButtonGlyph.Cheat22:
|
||||
case Def.ButtonGlyph.Cheat31:
|
||||
case Def.ButtonGlyph.Cheat32:
|
||||
case Def.ButtonGlyph.Cheat1:
|
||||
case Def.ButtonGlyph.Cheat2:
|
||||
case Def.ButtonGlyph.Cheat3:
|
||||
case Def.ButtonGlyph.Cheat4:
|
||||
case Def.ButtonGlyph.Cheat5:
|
||||
case Def.ButtonGlyph.Cheat6:
|
||||
case Def.ButtonGlyph.Cheat7:
|
||||
case Def.ButtonGlyph.Cheat8:
|
||||
case Def.ButtonGlyph.Cheat9:
|
||||
accelWaitZero = false;
|
||||
buttonGlyph = pressedGlyph;
|
||||
showCheatMenu = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (buttonGlyph != 0 && buttonGlyph != Def.ButtonGlyph.PlayAction && buttonGlyph != Def.ButtonGlyph.Cheat11 && buttonGlyph != Def.ButtonGlyph.Cheat12 && buttonGlyph != Def.ButtonGlyph.Cheat21 && buttonGlyph != Def.ButtonGlyph.Cheat22 && buttonGlyph != Def.ButtonGlyph.Cheat31 && buttonGlyph != Def.ButtonGlyph.Cheat32 && lastButtonDown == Def.ButtonGlyph.None)
|
||||
{
|
||||
TinyPoint pos = new TinyPoint(320, 240);
|
||||
sound.PlayImage(0, pos);
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlyph.None && lastButtonDown != 0)
|
||||
{
|
||||
buttonPressed = lastButtonDown;
|
||||
}
|
||||
lastButtonDown = buttonGlyph;
|
||||
if (padPressed)
|
||||
{
|
||||
Debug.WriteLine("PadCenter.X=" + PadCenter.X);
|
||||
Debug.WriteLine("PadCenter.Y=" + PadCenter.Y);
|
||||
Debug.WriteLine("padTouchPos.X=" + padTouchPos.X);
|
||||
Debug.WriteLine("padTouchPos.Y=" + padTouchPos.Y);
|
||||
Debug.WriteLine("keyPressedUp=" + keyPressedUp);
|
||||
Debug.WriteLine("keyPressedDown=" + keyPressedDown);
|
||||
Debug.WriteLine("keyPressedLeft=" + keyPressedLeft);
|
||||
Debug.WriteLine(" keyPressedRight=" + keyPressedRight);
|
||||
{
|
||||
if (keyPressedUp)
|
||||
{
|
||||
padTouchPos.Y = PadCenter.Y - 30;
|
||||
padTouchPos.X = PadCenter.X;
|
||||
if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30;
|
||||
if (keyPressedRight) padTouchPos.X = PadCenter.X + 30;
|
||||
}
|
||||
if (keyPressedDown) {
|
||||
padTouchPos.Y = PadCenter.Y + 30;
|
||||
padTouchPos.X = PadCenter.X;
|
||||
if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30;
|
||||
if (keyPressedRight) padTouchPos.X = PadCenter.X + 30;
|
||||
}
|
||||
if (keyPressedLeft) {
|
||||
padTouchPos.X = PadCenter.X - 30;
|
||||
padTouchPos.Y = PadCenter.Y;
|
||||
if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30;
|
||||
if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30;
|
||||
}
|
||||
if (keyPressedRight) {
|
||||
padTouchPos.X = PadCenter.X + 30;
|
||||
padTouchPos.Y = PadCenter.Y;
|
||||
if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30;
|
||||
if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30;
|
||||
}
|
||||
}
|
||||
double horizontalPosition = padTouchPos.X - PadCenter.X;
|
||||
double verticalPosition = padTouchPos.Y - PadCenter.Y;
|
||||
|
||||
if (horizontalPosition > 20.0)
|
||||
{
|
||||
horizontalChange += 1.0;
|
||||
Debug.WriteLine(" horizontalChange += 1.0;");
|
||||
}
|
||||
if (horizontalPosition < -20.0)
|
||||
{
|
||||
horizontalChange -= 1.0;
|
||||
Debug.WriteLine(" horizontalChange -= 1.0;");
|
||||
|
||||
}
|
||||
if (verticalPosition > 20.0)
|
||||
{
|
||||
verticalChange += 1.0;
|
||||
Debug.WriteLine(" verticalPosition += 1.0;");
|
||||
|
||||
}
|
||||
if (verticalPosition < -20.0)
|
||||
{
|
||||
verticalChange -= 1.0;
|
||||
Debug.WriteLine(" verticalPosition -= 1.0;");
|
||||
}
|
||||
|
||||
}
|
||||
if (accelStarted)
|
||||
{
|
||||
horizontalChange = accelSpeedX;
|
||||
verticalChange = 0.0;
|
||||
if (((uint)keyPress & 4u) != 0)
|
||||
{
|
||||
verticalChange = 1.0;
|
||||
}
|
||||
}
|
||||
decor.SetSpeedX(horizontalChange);
|
||||
decor.SetSpeedY(verticalChange);
|
||||
decor.KeyChange(keyPress);
|
||||
}
|
||||
|
||||
private Def.ButtonGlyph ButtonDetect(TinyPoint touchOrClick)
|
||||
{
|
||||
foreach (Def.ButtonGlyph buttonGlyph in ButtonGlyphs.Reverse())
|
||||
{
|
||||
TinyRect buttonRect = GetButtonRect(buttonGlyph);
|
||||
|
||||
if (buttonGlyph == Def.ButtonGlyph.PlayJump || buttonGlyph == Def.ButtonGlyph.PlayAction || buttonGlyph == Def.ButtonGlyph.PlayDown || buttonGlyph == Def.ButtonGlyph.PlayPause)
|
||||
{
|
||||
buttonRect = Misc.Inflate(buttonRect, 20);
|
||||
}
|
||||
|
||||
if (Misc.IsInside(buttonRect, touchOrClick))
|
||||
{
|
||||
return buttonGlyph;
|
||||
}
|
||||
}
|
||||
return Def.ButtonGlyph.None;
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (!accelStarted && Phase == Def.Phase.Play)
|
||||
{
|
||||
pixmap.DrawIcon(14, 0, GetPadBounds(PadCenter, padRadius / 2), 1.0, false);
|
||||
TinyPoint center = (padPressed ? padTouchPos : PadCenter);
|
||||
pixmap.DrawIcon(14, 1, GetPadBounds(center, padRadius / 2), 1.0, false);
|
||||
}
|
||||
foreach (Def.ButtonGlyph buttonGlyph in ButtonGlyphs)
|
||||
{
|
||||
bool pressed = pressedGlyphs.Contains(buttonGlyph);
|
||||
bool selected = false;
|
||||
if (buttonGlyph >= Def.ButtonGlyph.InitGamerA && buttonGlyph <= Def.ButtonGlyph.InitGamerC)
|
||||
{
|
||||
int selectedGamer = (int)(buttonGlyph - 1);
|
||||
selected = selectedGamer == gameData.SelectedGamer;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlyph.SetupSounds)
|
||||
{
|
||||
selected = gameData.Sounds;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlyph.SetupJump)
|
||||
{
|
||||
selected = gameData.JumpRight;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlyph.SetupZoom)
|
||||
{
|
||||
selected = gameData.AutoZoom;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlyph.SetupAccel)
|
||||
{
|
||||
selected = gameData.AccelActive;
|
||||
}
|
||||
pixmap.DrawInputButton(GetButtonRect(buttonGlyph), buttonGlyph, pressed, selected);
|
||||
}
|
||||
if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && gameData.AccelActive)
|
||||
{
|
||||
accelSlider.Draw(pixmap);
|
||||
}
|
||||
}
|
||||
|
||||
private TinyRect GetPadBounds(TinyPoint center, int radius)
|
||||
{
|
||||
return new TinyRect(center.X - radius, center.X + radius, center.Y - radius, center.Y + radius);
|
||||
}
|
||||
|
||||
public TinyRect GetButtonRect(Def.ButtonGlyph glyph)
|
||||
{
|
||||
TinyRect drawBounds = pixmap.DrawBounds;
|
||||
double drawBoundsWidth = drawBounds.Width;
|
||||
double drawBoundsHeight = drawBounds.Height;
|
||||
double buttonSizeFactor1 = drawBoundsHeight / 5.0;
|
||||
double buttonSizeFactor2 = drawBoundsHeight * 140.0 / 480.0;
|
||||
double cheatButtonSizeFactor = drawBoundsHeight / 3.5;
|
||||
if (glyph >= Def.ButtonGlyph.Cheat1 && glyph <= Def.ButtonGlyph.Cheat9)
|
||||
{
|
||||
int cheatNumber = (int)(glyph - 35);
|
||||
TinyRect result = default(TinyRect);
|
||||
result.LeftX = 80 * cheatNumber;
|
||||
result.RightX = 80 * (cheatNumber + 1);
|
||||
result.TopY = 0;
|
||||
result.BottomY = 80;
|
||||
return result;
|
||||
}
|
||||
int leftXForButtonsInLeftColumn = (int)(20.0 + buttonSizeFactor2 * 0.0);
|
||||
int rightXForButtonsInLeftColumn = (int)(20.0 + buttonSizeFactor2 * 0.5);
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlyph.InitGamerA:
|
||||
{
|
||||
TinyRect result19 = default(TinyRect);
|
||||
result19.LeftX = leftXForButtonsInLeftColumn;
|
||||
result19.RightX = rightXForButtonsInLeftColumn;
|
||||
result19.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.1);
|
||||
result19.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6);
|
||||
return result19;
|
||||
}
|
||||
case Def.ButtonGlyph.InitGamerB:
|
||||
{
|
||||
TinyRect result18 = default(TinyRect);
|
||||
result18.LeftX = leftXForButtonsInLeftColumn;
|
||||
result18.RightX = rightXForButtonsInLeftColumn;
|
||||
result18.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6);
|
||||
result18.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.1);
|
||||
return result18;
|
||||
}
|
||||
case Def.ButtonGlyph.InitGamerC:
|
||||
{
|
||||
TinyRect result15 = default(TinyRect);
|
||||
result15.LeftX = leftXForButtonsInLeftColumn;
|
||||
result15.RightX = rightXForButtonsInLeftColumn;
|
||||
result15.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.1);
|
||||
result15.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.6);
|
||||
return result15;
|
||||
}
|
||||
case Def.ButtonGlyph.InitSetup:
|
||||
{
|
||||
TinyRect result14 = default(TinyRect);
|
||||
result14.LeftX = leftXForButtonsInLeftColumn;
|
||||
result14.RightX = rightXForButtonsInLeftColumn;
|
||||
result14.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5);
|
||||
result14.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0);
|
||||
return result14;
|
||||
}
|
||||
case Def.ButtonGlyph.InitPlay:
|
||||
{
|
||||
TinyRect result11 = default(TinyRect);
|
||||
result11.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 1.0);
|
||||
result11.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.0);
|
||||
result11.TopY = (int)(drawBoundsHeight - 40.0 - buttonSizeFactor2 * 1.0);
|
||||
result11.BottomY = (int)(drawBoundsHeight - 40.0 - buttonSizeFactor2 * 0.0);
|
||||
return result11;
|
||||
}
|
||||
case Def.ButtonGlyph.InitBuy:
|
||||
case Def.ButtonGlyph.InitRanking:
|
||||
{
|
||||
TinyRect result10 = default(TinyRect);
|
||||
result10.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.75);
|
||||
result10.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.25);
|
||||
result10.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.1);
|
||||
result10.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6);
|
||||
return result10;
|
||||
}
|
||||
case Def.ButtonGlyph.PauseMenu:
|
||||
{
|
||||
TinyRect result37 = default(TinyRect);
|
||||
result37.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * -0.21);
|
||||
result37.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 0.79);
|
||||
result37.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result37.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result37;
|
||||
}
|
||||
case Def.ButtonGlyph.PauseBack:
|
||||
{
|
||||
TinyRect result36 = default(TinyRect);
|
||||
result36.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 0.79);
|
||||
result36.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.79);
|
||||
result36.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result36.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result36;
|
||||
}
|
||||
case Def.ButtonGlyph.PauseSetup:
|
||||
{
|
||||
TinyRect result35 = default(TinyRect);
|
||||
result35.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.79);
|
||||
result35.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.79);
|
||||
result35.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result35.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result35;
|
||||
}
|
||||
case Def.ButtonGlyph.PauseRestart:
|
||||
{
|
||||
TinyRect result34 = default(TinyRect);
|
||||
result34.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.79);
|
||||
result34.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.79);
|
||||
result34.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result34.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result34;
|
||||
}
|
||||
case Def.ButtonGlyph.PauseContinue:
|
||||
{
|
||||
TinyRect result33 = default(TinyRect);
|
||||
result33.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.79);
|
||||
result33.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.79);
|
||||
result33.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result33.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result33;
|
||||
}
|
||||
case Def.ButtonGlyph.ResumeMenu:
|
||||
{
|
||||
TinyRect result32 = default(TinyRect);
|
||||
result32.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.29);
|
||||
result32.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.29);
|
||||
result32.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result32.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result32;
|
||||
}
|
||||
case Def.ButtonGlyph.ResumeContinue:
|
||||
{
|
||||
TinyRect result31 = default(TinyRect);
|
||||
result31.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.29);
|
||||
result31.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.29);
|
||||
result31.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2);
|
||||
result31.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2);
|
||||
return result31;
|
||||
}
|
||||
case Def.ButtonGlyph.WinLostReturn:
|
||||
{
|
||||
TinyRect result30 = default(TinyRect);
|
||||
result30.LeftX = (int)((double)PixmapOrigin.X + drawBoundsWidth - buttonSizeFactor1 * 2.2);
|
||||
result30.RightX = (int)((double)PixmapOrigin.X + drawBoundsWidth - buttonSizeFactor1 * 1.2);
|
||||
result30.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor1 * 0.2);
|
||||
result30.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor1 * 1.2);
|
||||
return result30;
|
||||
}
|
||||
case Def.ButtonGlyph.TrialBuy:
|
||||
{
|
||||
TinyRect result29 = default(TinyRect);
|
||||
result29.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.5);
|
||||
result29.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5);
|
||||
result29.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1);
|
||||
result29.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1);
|
||||
return result29;
|
||||
}
|
||||
case Def.ButtonGlyph.TrialCancel:
|
||||
{
|
||||
TinyRect result28 = default(TinyRect);
|
||||
result28.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5);
|
||||
result28.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.5);
|
||||
result28.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1);
|
||||
result28.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1);
|
||||
return result28;
|
||||
}
|
||||
case Def.ButtonGlyph.RankingContinue:
|
||||
{
|
||||
TinyRect result27 = default(TinyRect);
|
||||
result27.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5);
|
||||
result27.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.5);
|
||||
result27.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1);
|
||||
result27.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1);
|
||||
return result27;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupSounds:
|
||||
{
|
||||
TinyRect result26 = default(TinyRect);
|
||||
result26.LeftX = leftXForButtonsInLeftColumn;
|
||||
result26.RightX = rightXForButtonsInLeftColumn;
|
||||
result26.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.0);
|
||||
result26.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5);
|
||||
return result26;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupJump:
|
||||
{
|
||||
TinyRect result25 = default(TinyRect);
|
||||
result25.LeftX = leftXForButtonsInLeftColumn;
|
||||
result25.RightX = rightXForButtonsInLeftColumn;
|
||||
result25.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5);
|
||||
result25.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.0);
|
||||
return result25;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupZoom:
|
||||
{
|
||||
TinyRect result24 = default(TinyRect);
|
||||
result24.LeftX = leftXForButtonsInLeftColumn;
|
||||
result24.RightX = rightXForButtonsInLeftColumn;
|
||||
result24.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.0);
|
||||
result24.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5);
|
||||
return result24;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupAccel:
|
||||
{
|
||||
TinyRect result23 = default(TinyRect);
|
||||
result23.LeftX = leftXForButtonsInLeftColumn;
|
||||
result23.RightX = rightXForButtonsInLeftColumn;
|
||||
result23.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5);
|
||||
result23.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0);
|
||||
return result23;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupReset:
|
||||
{
|
||||
TinyRect result22 = default(TinyRect);
|
||||
result22.LeftX = (int)(450.0 + buttonSizeFactor2 * 0.0);
|
||||
result22.RightX = (int)(450.0 + buttonSizeFactor2 * 0.5);
|
||||
result22.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.0);
|
||||
result22.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5);
|
||||
return result22;
|
||||
}
|
||||
case Def.ButtonGlyph.SetupReturn:
|
||||
{
|
||||
TinyRect result21 = default(TinyRect);
|
||||
result21.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.8);
|
||||
result21.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.0);
|
||||
result21.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.8);
|
||||
result21.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0);
|
||||
return result21;
|
||||
}
|
||||
case Def.ButtonGlyph.PlayPause:
|
||||
{
|
||||
TinyRect result20 = default(TinyRect);
|
||||
result20.LeftX = (int)(drawBoundsWidth - buttonSizeFactor1 * 0.7);
|
||||
result20.RightX = (int)(drawBoundsWidth - buttonSizeFactor1 * 0.2);
|
||||
result20.TopY = (int)(buttonSizeFactor1 * 0.2);
|
||||
result20.BottomY = (int)(buttonSizeFactor1 * 0.7);
|
||||
return result20;
|
||||
}
|
||||
case Def.ButtonGlyph.PlayAction:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result16 = default(TinyRect);
|
||||
result16.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2);
|
||||
result16.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2);
|
||||
result16.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 2.6);
|
||||
result16.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.6);
|
||||
return result16;
|
||||
}
|
||||
TinyRect result17 = default(TinyRect);
|
||||
result17.LeftX = (int)(buttonSizeFactor1 * 0.2);
|
||||
result17.RightX = (int)(buttonSizeFactor1 * 1.2);
|
||||
result17.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 2.6);
|
||||
result17.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.6);
|
||||
return result17;
|
||||
}
|
||||
case Def.ButtonGlyph.PlayJump:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result12 = default(TinyRect);
|
||||
result12.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2);
|
||||
result12.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2);
|
||||
result12.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2);
|
||||
result12.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2);
|
||||
return result12;
|
||||
}
|
||||
TinyRect result13 = default(TinyRect);
|
||||
result13.LeftX = (int)(buttonSizeFactor1 * 0.2);
|
||||
result13.RightX = (int)(buttonSizeFactor1 * 1.2);
|
||||
result13.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2);
|
||||
result13.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2);
|
||||
return result13;
|
||||
}
|
||||
case Def.ButtonGlyph.PlayDown:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result8 = default(TinyRect);
|
||||
result8.LeftX = (int)(buttonSizeFactor1 * 0.2);
|
||||
result8.RightX = (int)(buttonSizeFactor1 * 1.2);
|
||||
result8.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2);
|
||||
result8.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2);
|
||||
return result8;
|
||||
}
|
||||
TinyRect result9 = default(TinyRect);
|
||||
result9.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2);
|
||||
result9.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2);
|
||||
result9.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2);
|
||||
result9.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2);
|
||||
return result9;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat11:
|
||||
{
|
||||
TinyRect result7 = default(TinyRect);
|
||||
result7.LeftX = (int)(cheatButtonSizeFactor * 0.0);
|
||||
result7.RightX = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result7.TopY = (int)(cheatButtonSizeFactor * 0.0);
|
||||
result7.BottomY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
return result7;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat12:
|
||||
{
|
||||
TinyRect result6 = default(TinyRect);
|
||||
result6.LeftX = (int)(cheatButtonSizeFactor * 0.0);
|
||||
result6.RightX = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result6.TopY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result6.BottomY = (int)(cheatButtonSizeFactor * 2.0);
|
||||
return result6;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat21:
|
||||
{
|
||||
TinyRect result5 = default(TinyRect);
|
||||
result5.LeftX = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result5.RightX = (int)(cheatButtonSizeFactor * 2.0);
|
||||
result5.TopY = (int)(cheatButtonSizeFactor * 0.0);
|
||||
result5.BottomY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
return result5;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat22:
|
||||
{
|
||||
TinyRect result4 = default(TinyRect);
|
||||
result4.LeftX = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result4.RightX = (int)(cheatButtonSizeFactor * 2.0);
|
||||
result4.TopY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result4.BottomY = (int)(cheatButtonSizeFactor * 2.0);
|
||||
return result4;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat31:
|
||||
{
|
||||
TinyRect result3 = default(TinyRect);
|
||||
result3.LeftX = (int)(cheatButtonSizeFactor * 2.0);
|
||||
result3.RightX = (int)(cheatButtonSizeFactor * 3.0);
|
||||
result3.TopY = (int)(cheatButtonSizeFactor * 0.0);
|
||||
result3.BottomY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
return result3;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat32:
|
||||
{
|
||||
TinyRect result2 = default(TinyRect);
|
||||
result2.LeftX = (int)(cheatButtonSizeFactor * 2.0);
|
||||
result2.RightX = (int)(cheatButtonSizeFactor * 3.0);
|
||||
result2.TopY = (int)(cheatButtonSizeFactor * 1.0);
|
||||
result2.BottomY = (int)(cheatButtonSizeFactor * 2.0);
|
||||
return result2;
|
||||
}
|
||||
default:
|
||||
return default(TinyRect);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartAccel()
|
||||
{
|
||||
try
|
||||
{
|
||||
accelSensor.Start();
|
||||
accelStarted = true;
|
||||
}
|
||||
catch (AccelerometerFailedException)
|
||||
{
|
||||
accelStarted = false;
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
accelStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void StopAccel()
|
||||
{
|
||||
if (accelStarted)
|
||||
{
|
||||
try
|
||||
{
|
||||
accelSensor.Stop();
|
||||
}
|
||||
catch (AccelerometerFailedException)
|
||||
{
|
||||
}
|
||||
accelStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void HandleAccelSensorCurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
|
||||
{
|
||||
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
|
||||
|
||||
AccelerometerReading sensorReading = e.SensorReading;
|
||||
float y = ((AccelerometerReading)(sensorReading)).Acceleration.Y;
|
||||
float sensitivityThreshold = (1f - (float)gameData.AccelSensitivity) * 0.06f + 0.04f;
|
||||
float adjustedThreshold = (accelLastState ? (sensitivityThreshold * 0.6f) : sensitivityThreshold);
|
||||
if (y > adjustedThreshold)
|
||||
{
|
||||
accelSpeedX = 0.0 - Math.Min((double)y * 0.25 / (double)sensitivityThreshold + 0.25, 1.0);
|
||||
}
|
||||
else if (y < 0f - adjustedThreshold)
|
||||
{
|
||||
accelSpeedX = Math.Min((double)(0f - y) * 0.25 / (double)sensitivityThreshold + 0.25, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
accelSpeedX = 0.0;
|
||||
}
|
||||
accelLastState = accelSpeedX != 0.0;
|
||||
if (accelWaitZero)
|
||||
{
|
||||
if (accelSpeedX == 0.0)
|
||||
{
|
||||
accelWaitZero = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
accelSpeedX = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Jauge
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Jauge
|
||||
{
|
||||
private Pixmap m_pixmap;
|
||||
|
||||
private Sound m_sound;
|
||||
|
||||
private bool m_bHide;
|
||||
|
||||
private TinyPoint m_pos;
|
||||
|
||||
private TinyPoint m_dim;
|
||||
|
||||
private int m_mode;
|
||||
|
||||
private int m_level;
|
||||
|
||||
private bool m_bMinimizeRedraw;
|
||||
|
||||
private bool m_bRedraw;
|
||||
|
||||
private double m_zoom;
|
||||
|
||||
public double Zoom
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_zoom;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_zoom = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Jauge()
|
||||
{
|
||||
m_mode = 0;
|
||||
m_bHide = true;
|
||||
m_bMinimizeRedraw = false;
|
||||
m_bRedraw = false;
|
||||
m_zoom = 1.0;
|
||||
}
|
||||
|
||||
public bool Create(Pixmap pixmap, Sound sound, TinyPoint pos, int mode, bool bMinimizeRedraw)
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
m_sound = sound;
|
||||
m_mode = mode;
|
||||
m_bMinimizeRedraw = bMinimizeRedraw;
|
||||
m_bHide = true;
|
||||
m_pos = pos;
|
||||
m_dim.X = 124;
|
||||
m_dim.Y = 22;
|
||||
m_level = 0;
|
||||
m_bRedraw = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
TinyRect rect = default(TinyRect);
|
||||
if (m_bMinimizeRedraw && !m_bRedraw)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_bRedraw = false;
|
||||
if (!m_bHide)
|
||||
{
|
||||
int num = m_level * 114 / 100;
|
||||
rect.LeftX = 0;
|
||||
rect.RightX = 124;
|
||||
rect.TopY = 0;
|
||||
rect.BottomY = 22;
|
||||
m_pixmap.DrawPart(5, m_pos, rect, m_zoom);
|
||||
if (num > 0)
|
||||
{
|
||||
rect.LeftX = 0;
|
||||
rect.RightX = 6 + num;
|
||||
rect.TopY = 22 * m_mode;
|
||||
rect.BottomY = 22 * (m_mode + 1);
|
||||
m_pixmap.DrawPart(5, m_pos, rect, m_zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Redraw()
|
||||
{
|
||||
m_bRedraw = true;
|
||||
}
|
||||
|
||||
public int GetLevel()
|
||||
{
|
||||
return m_level;
|
||||
}
|
||||
|
||||
public void SetLevel(int level)
|
||||
{
|
||||
if (level < 0)
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
if (level > 100)
|
||||
{
|
||||
level = 100;
|
||||
}
|
||||
if (m_level != level)
|
||||
{
|
||||
m_bRedraw = true;
|
||||
}
|
||||
m_level = level;
|
||||
}
|
||||
|
||||
public int GetMode()
|
||||
{
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
public void SetMode(int mode)
|
||||
{
|
||||
if (m_mode != mode)
|
||||
{
|
||||
m_bRedraw = true;
|
||||
}
|
||||
m_mode = mode;
|
||||
}
|
||||
|
||||
public bool GetHide()
|
||||
{
|
||||
return m_bHide;
|
||||
}
|
||||
|
||||
public void SetHide(bool bHide)
|
||||
{
|
||||
if (m_bHide != bHide)
|
||||
{
|
||||
m_bRedraw = true;
|
||||
}
|
||||
m_bHide = bHide;
|
||||
}
|
||||
|
||||
public TinyPoint GetPos()
|
||||
{
|
||||
return m_pos;
|
||||
}
|
||||
|
||||
public void SetRedraw()
|
||||
{
|
||||
m_bRedraw = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Misc
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
using static WindowsPhoneSpeedyBlupi.Def;
|
||||
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public static class Misc
|
||||
{
|
||||
public static Rectangle RotateAdjust(Rectangle rect, double angle)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = rect.Width / 2;
|
||||
tinyPoint.Y = rect.Height / 2;
|
||||
TinyPoint p = tinyPoint;
|
||||
TinyPoint tinyPoint2 = RotatePointRad(angle, p);
|
||||
int num = tinyPoint2.X - p.X;
|
||||
int num2 = tinyPoint2.Y - p.Y;
|
||||
return new Rectangle(rect.Left - num, rect.Top - num2, rect.Width, rect.Height);
|
||||
}
|
||||
|
||||
public static TinyPoint RotatePointRad(double angle, TinyPoint p)
|
||||
{
|
||||
return RotatePointRad(default(TinyPoint), angle, p);
|
||||
}
|
||||
|
||||
public static TinyPoint RotatePointRad(TinyPoint center, double angle, TinyPoint p)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
TinyPoint result = default(TinyPoint);
|
||||
tinyPoint.X = p.X - center.X;
|
||||
tinyPoint.Y = p.Y - center.Y;
|
||||
double num = Math.Sin(angle);
|
||||
double num2 = Math.Cos(angle);
|
||||
result.X = (int)((double)tinyPoint.X * num2 - (double)tinyPoint.Y * num);
|
||||
result.Y = (int)((double)tinyPoint.X * num + (double)tinyPoint.Y * num2);
|
||||
result.X += center.X;
|
||||
result.Y += center.Y;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static double DegToRad(double angle)
|
||||
{
|
||||
return angle * Math.PI / 180.0;
|
||||
}
|
||||
|
||||
public static int Approch(int actual, int final, int step)
|
||||
{
|
||||
if (actual < final)
|
||||
{
|
||||
actual = Math.Min(actual + step, final);
|
||||
}
|
||||
else if (actual > final)
|
||||
{
|
||||
actual = Math.Max(actual - step, final);
|
||||
}
|
||||
return actual;
|
||||
}
|
||||
|
||||
public static int Speed(double speed, int max)
|
||||
{
|
||||
if (speed > 0.0)
|
||||
{
|
||||
return Math.Max((int)(speed * (double)max), 1);
|
||||
}
|
||||
if (speed < 0.0)
|
||||
{
|
||||
return Math.Min((int)(speed * (double)max), -1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static TinyRect Inflate(TinyRect rect, int value)
|
||||
{
|
||||
TinyRect result = default(TinyRect);
|
||||
result.LeftX = rect.LeftX - value;
|
||||
result.RightX = rect.RightX + value;
|
||||
result.TopY = rect.TopY - value;
|
||||
result.BottomY = rect.BottomY + value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool IsInside(TinyRect rect, TinyPoint p)
|
||||
{
|
||||
return p.X >= rect.LeftX && p.X <= rect.RightX && p.Y >= rect.TopY && p.Y <= rect.BottomY;
|
||||
}
|
||||
|
||||
public static bool IntersectRect(out TinyRect dst, TinyRect src1, TinyRect src2)
|
||||
{
|
||||
dst = default(TinyRect);
|
||||
dst.LeftX = Math.Max(src1.LeftX, src2.LeftX);
|
||||
dst.RightX = Math.Min(src1.RightX, src2.RightX);
|
||||
dst.TopY = Math.Max(src1.TopY, src2.TopY);
|
||||
dst.BottomY = Math.Min(src1.BottomY, src2.BottomY);
|
||||
return !IsRectEmpty(dst);
|
||||
}
|
||||
|
||||
public static bool UnionRect(out TinyRect dst, TinyRect src1, TinyRect src2)
|
||||
{
|
||||
dst = default(TinyRect);
|
||||
dst.LeftX = Math.Min(src1.LeftX, src2.LeftX);
|
||||
dst.RightX = Math.Max(src1.RightX, src2.RightX);
|
||||
dst.TopY = Math.Min(src1.TopY, src2.TopY);
|
||||
dst.BottomY = Math.Max(src1.BottomY, src2.BottomY);
|
||||
return !IsRectEmpty(dst);
|
||||
}
|
||||
|
||||
private static bool IsRectEmpty(TinyRect rect)
|
||||
{
|
||||
if (rect.LeftX < rect.RightX)
|
||||
{
|
||||
return rect.TopY >= rect.BottomY;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,776 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.MyResource
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public static class MyResource
|
||||
{
|
||||
public static readonly int TX_BUTTON_PLAY;
|
||||
|
||||
public static readonly int TX_BUTTON_MENU;
|
||||
|
||||
public static readonly int TX_BUTTON_BACK;
|
||||
|
||||
public static readonly int TX_BUTTON_RESTART;
|
||||
|
||||
public static readonly int TX_BUTTON_CONTINUE;
|
||||
|
||||
public static readonly int TX_BUTTON_BUY;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP_SOUNDS;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP_JUMP;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP_ZOOM;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP_ACCEL;
|
||||
|
||||
public static readonly int TX_BUTTON_SETUP_RESET;
|
||||
|
||||
public static readonly int TX_BUTTON_RANKING;
|
||||
|
||||
public static readonly int TX_GAMER_TITLE;
|
||||
|
||||
public static readonly int TX_GAMER_MDOORS;
|
||||
|
||||
public static readonly int TX_GAMER_SDOORS;
|
||||
|
||||
public static readonly int TX_GAMER_LIFES;
|
||||
|
||||
public static readonly int TX_TRIAL1;
|
||||
|
||||
public static readonly int TX_TRIAL2;
|
||||
|
||||
public static readonly int TX_TRIAL3;
|
||||
|
||||
public static readonly int TX_TRIAL4;
|
||||
|
||||
public static readonly int TX_TRIAL5;
|
||||
|
||||
public static readonly int TX_TRIAL6;
|
||||
|
||||
public static readonly int TX_TRAINING101;
|
||||
|
||||
public static readonly int TX_TRAINING102;
|
||||
|
||||
public static readonly int TX_TRAINING103;
|
||||
|
||||
public static readonly int TX_TRAINING104;
|
||||
|
||||
public static readonly int TX_TRAINING105;
|
||||
|
||||
public static readonly int TX_TRAINING106;
|
||||
|
||||
public static readonly int TX_TRAINING107;
|
||||
|
||||
public static readonly int TX_TRAINING108;
|
||||
|
||||
public static readonly int TX_TRAINING109;
|
||||
|
||||
public static readonly int TX_TRAINING110;
|
||||
|
||||
public static readonly int TX_TRAINING111;
|
||||
|
||||
public static readonly int TX_TRAINING112;
|
||||
|
||||
public static readonly int TX_TRAINING113;
|
||||
|
||||
public static readonly int TX_TRAINING114;
|
||||
|
||||
public static readonly int TX_TRAINING115;
|
||||
|
||||
public static readonly int TX_TRAINING116;
|
||||
|
||||
public static readonly int TX_TRAINING117;
|
||||
|
||||
public static readonly int TX_TRAINING118;
|
||||
|
||||
public static readonly int TX_TRAINING119;
|
||||
|
||||
public static readonly int TX_TRAINING120;
|
||||
|
||||
public static readonly int TX_TRAINING121;
|
||||
|
||||
public static readonly int TX_TRAINING122;
|
||||
|
||||
public static readonly int TX_TRAINING123;
|
||||
|
||||
public static readonly int TX_TRAINING201;
|
||||
|
||||
public static readonly int TX_TRAINING202;
|
||||
|
||||
public static readonly int TX_TRAINING203;
|
||||
|
||||
public static readonly int TX_TRAINING204;
|
||||
|
||||
public static readonly int TX_TRAINING205;
|
||||
|
||||
public static readonly int TX_TRAINING206;
|
||||
|
||||
public static readonly int TX_TRAINING207;
|
||||
|
||||
public static readonly int TX_TRAINING208;
|
||||
|
||||
public static readonly int TX_TRAINING209;
|
||||
|
||||
public static readonly int TX_TRAINING210;
|
||||
|
||||
public static readonly int TX_TRAINING301;
|
||||
|
||||
public static readonly int TX_TRAINING302;
|
||||
|
||||
public static readonly int TX_TRAINING303;
|
||||
|
||||
public static readonly int TX_TRAINING304;
|
||||
|
||||
public static readonly int TX_TRAINING305;
|
||||
|
||||
public static readonly int TX_TRAINING306;
|
||||
|
||||
public static readonly int TX_TRAINING307;
|
||||
|
||||
public static readonly int TX_TRAINING308;
|
||||
|
||||
public static readonly int TX_TRAINING309;
|
||||
|
||||
public static readonly int TX_TRAINING310;
|
||||
|
||||
public static readonly int TX_TRAINING311;
|
||||
|
||||
public static readonly int TX_TRAINING401;
|
||||
|
||||
public static readonly int TX_TRAINING402;
|
||||
|
||||
public static readonly int TX_TRAINING403;
|
||||
|
||||
public static readonly int TX_TRAINING404;
|
||||
|
||||
public static readonly int TX_TRAINING405;
|
||||
|
||||
public static readonly int TX_TRAINING406;
|
||||
|
||||
public static readonly int TX_TRAINING407;
|
||||
|
||||
public static readonly int TX_TRAINING408;
|
||||
|
||||
public static readonly int TX_TRAINING409;
|
||||
|
||||
public static readonly int TX_TRAINING410;
|
||||
|
||||
public static readonly int TX_TRAINING101a;
|
||||
|
||||
public static readonly int TX_TRAINING102a;
|
||||
|
||||
public static readonly int TX_TRAINING103a;
|
||||
|
||||
public static readonly int TX_TRAINING104a;
|
||||
|
||||
public static readonly int TX_TRAINING105a;
|
||||
|
||||
public static readonly int TX_TRAINING106a;
|
||||
|
||||
public static readonly int TX_TRAINING107a;
|
||||
|
||||
public static readonly int TX_TRAINING108a;
|
||||
|
||||
public static readonly int TX_TRAINING109a;
|
||||
|
||||
public static readonly int TX_TRAINING110a;
|
||||
|
||||
public static readonly int TX_TRAINING111a;
|
||||
|
||||
public static readonly int TX_TRAINING112a;
|
||||
|
||||
public static readonly int TX_TRAINING113a;
|
||||
|
||||
public static readonly int TX_TRAINING114a;
|
||||
|
||||
public static readonly int TX_TRAINING115a;
|
||||
|
||||
public static readonly int TX_TRAINING116a;
|
||||
|
||||
public static readonly int TX_TRAINING117a;
|
||||
|
||||
public static readonly int TX_TRAINING118a;
|
||||
|
||||
public static readonly int TX_TRAINING119a;
|
||||
|
||||
public static readonly int TX_TRAINING120a;
|
||||
|
||||
public static readonly int TX_TRAINING121a;
|
||||
|
||||
public static readonly int TX_TRAINING122a;
|
||||
|
||||
public static readonly int TX_TRAINING123a;
|
||||
|
||||
public static readonly int TX_TRAINING201a;
|
||||
|
||||
public static readonly int TX_TRAINING202a;
|
||||
|
||||
public static readonly int TX_TRAINING203a;
|
||||
|
||||
public static readonly int TX_TRAINING204a;
|
||||
|
||||
public static readonly int TX_TRAINING205a;
|
||||
|
||||
public static readonly int TX_TRAINING206a;
|
||||
|
||||
public static readonly int TX_TRAINING207a;
|
||||
|
||||
public static readonly int TX_TRAINING208a;
|
||||
|
||||
public static readonly int TX_TRAINING209a;
|
||||
|
||||
public static readonly int TX_TRAINING210a;
|
||||
|
||||
public static readonly int TX_TRAINING301a;
|
||||
|
||||
public static readonly int TX_TRAINING302a;
|
||||
|
||||
public static readonly int TX_TRAINING303a;
|
||||
|
||||
public static readonly int TX_TRAINING304a;
|
||||
|
||||
public static readonly int TX_TRAINING305a;
|
||||
|
||||
public static readonly int TX_TRAINING306a;
|
||||
|
||||
public static readonly int TX_TRAINING307a;
|
||||
|
||||
public static readonly int TX_TRAINING308a;
|
||||
|
||||
public static readonly int TX_TRAINING309a;
|
||||
|
||||
public static readonly int TX_TRAINING310a;
|
||||
|
||||
public static readonly int TX_TRAINING311a;
|
||||
|
||||
public static readonly int TX_TRAINING401a;
|
||||
|
||||
public static readonly int TX_TRAINING402a;
|
||||
|
||||
public static readonly int TX_TRAINING403a;
|
||||
|
||||
public static readonly int TX_TRAINING404a;
|
||||
|
||||
public static readonly int TX_TRAINING405a;
|
||||
|
||||
public static readonly int TX_TRAINING406a;
|
||||
|
||||
public static readonly int TX_TRAINING407a;
|
||||
|
||||
public static readonly int TX_TRAINING408a;
|
||||
|
||||
public static readonly int TX_TRAINING409a;
|
||||
|
||||
public static readonly int TX_TRAINING410a;
|
||||
|
||||
private static Dictionary<int, string> resources;
|
||||
|
||||
public static string LoadString(int res)
|
||||
{
|
||||
string value;
|
||||
if (resources.TryGetValue(res, out value))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
|
||||
static MyResource()
|
||||
{
|
||||
TX_BUTTON_PLAY = 100;
|
||||
TX_BUTTON_MENU = 101;
|
||||
TX_BUTTON_BACK = 102;
|
||||
TX_BUTTON_RESTART = 103;
|
||||
TX_BUTTON_CONTINUE = 104;
|
||||
TX_BUTTON_BUY = 105;
|
||||
TX_BUTTON_SETUP = 107;
|
||||
TX_BUTTON_SETUP_SOUNDS = 108;
|
||||
TX_BUTTON_SETUP_JUMP = 109;
|
||||
TX_BUTTON_SETUP_ZOOM = 110;
|
||||
TX_BUTTON_SETUP_ACCEL = 111;
|
||||
TX_BUTTON_SETUP_RESET = 112;
|
||||
TX_BUTTON_RANKING = 113;
|
||||
TX_GAMER_TITLE = 200;
|
||||
TX_GAMER_MDOORS = 201;
|
||||
TX_GAMER_SDOORS = 202;
|
||||
TX_GAMER_LIFES = 203;
|
||||
TX_TRIAL1 = 300;
|
||||
TX_TRIAL2 = 301;
|
||||
TX_TRIAL3 = 302;
|
||||
TX_TRIAL4 = 303;
|
||||
TX_TRIAL5 = 304;
|
||||
TX_TRIAL6 = 305;
|
||||
TX_TRAINING101 = 1000;
|
||||
TX_TRAINING102 = 1001;
|
||||
TX_TRAINING103 = 1002;
|
||||
TX_TRAINING104 = 1003;
|
||||
TX_TRAINING105 = 1004;
|
||||
TX_TRAINING106 = 1005;
|
||||
TX_TRAINING107 = 1006;
|
||||
TX_TRAINING108 = 1007;
|
||||
TX_TRAINING109 = 1008;
|
||||
TX_TRAINING110 = 1009;
|
||||
TX_TRAINING111 = 1010;
|
||||
TX_TRAINING112 = 1011;
|
||||
TX_TRAINING113 = 1012;
|
||||
TX_TRAINING114 = 1013;
|
||||
TX_TRAINING115 = 1014;
|
||||
TX_TRAINING116 = 1015;
|
||||
TX_TRAINING117 = 1016;
|
||||
TX_TRAINING118 = 1017;
|
||||
TX_TRAINING119 = 1018;
|
||||
TX_TRAINING120 = 1019;
|
||||
TX_TRAINING121 = 1020;
|
||||
TX_TRAINING122 = 1021;
|
||||
TX_TRAINING123 = 1022;
|
||||
TX_TRAINING201 = 2000;
|
||||
TX_TRAINING202 = 2001;
|
||||
TX_TRAINING203 = 2002;
|
||||
TX_TRAINING204 = 2003;
|
||||
TX_TRAINING205 = 2004;
|
||||
TX_TRAINING206 = 2005;
|
||||
TX_TRAINING207 = 2006;
|
||||
TX_TRAINING208 = 2007;
|
||||
TX_TRAINING209 = 2008;
|
||||
TX_TRAINING210 = 2009;
|
||||
TX_TRAINING301 = 3000;
|
||||
TX_TRAINING302 = 3001;
|
||||
TX_TRAINING303 = 3002;
|
||||
TX_TRAINING304 = 3003;
|
||||
TX_TRAINING305 = 3004;
|
||||
TX_TRAINING306 = 3005;
|
||||
TX_TRAINING307 = 3006;
|
||||
TX_TRAINING308 = 3007;
|
||||
TX_TRAINING309 = 3008;
|
||||
TX_TRAINING310 = 3009;
|
||||
TX_TRAINING311 = 3010;
|
||||
TX_TRAINING401 = 4000;
|
||||
TX_TRAINING402 = 4001;
|
||||
TX_TRAINING403 = 4002;
|
||||
TX_TRAINING404 = 4003;
|
||||
TX_TRAINING405 = 4004;
|
||||
TX_TRAINING406 = 4005;
|
||||
TX_TRAINING407 = 4006;
|
||||
TX_TRAINING408 = 4007;
|
||||
TX_TRAINING409 = 4008;
|
||||
TX_TRAINING410 = 4009;
|
||||
TX_TRAINING101a = 11000;
|
||||
TX_TRAINING102a = 11001;
|
||||
TX_TRAINING103a = 11002;
|
||||
TX_TRAINING104a = 11003;
|
||||
TX_TRAINING105a = 11004;
|
||||
TX_TRAINING106a = 11005;
|
||||
TX_TRAINING107a = 11006;
|
||||
TX_TRAINING108a = 11007;
|
||||
TX_TRAINING109a = 11008;
|
||||
TX_TRAINING110a = 11009;
|
||||
TX_TRAINING111a = 11010;
|
||||
TX_TRAINING112a = 11011;
|
||||
TX_TRAINING113a = 11012;
|
||||
TX_TRAINING114a = 11013;
|
||||
TX_TRAINING115a = 11014;
|
||||
TX_TRAINING116a = 11015;
|
||||
TX_TRAINING117a = 11016;
|
||||
TX_TRAINING118a = 11017;
|
||||
TX_TRAINING119a = 11018;
|
||||
TX_TRAINING120a = 11019;
|
||||
TX_TRAINING121a = 11020;
|
||||
TX_TRAINING122a = 11021;
|
||||
TX_TRAINING123a = 11022;
|
||||
TX_TRAINING201a = 12000;
|
||||
TX_TRAINING202a = 12001;
|
||||
TX_TRAINING203a = 12002;
|
||||
TX_TRAINING204a = 12003;
|
||||
TX_TRAINING205a = 12004;
|
||||
TX_TRAINING206a = 12005;
|
||||
TX_TRAINING207a = 12006;
|
||||
TX_TRAINING208a = 12007;
|
||||
TX_TRAINING209a = 12008;
|
||||
TX_TRAINING210a = 12009;
|
||||
TX_TRAINING301a = 13000;
|
||||
TX_TRAINING302a = 13001;
|
||||
TX_TRAINING303a = 13002;
|
||||
TX_TRAINING304a = 13003;
|
||||
TX_TRAINING305a = 13004;
|
||||
TX_TRAINING306a = 13005;
|
||||
TX_TRAINING307a = 13006;
|
||||
TX_TRAINING308a = 13007;
|
||||
TX_TRAINING309a = 13008;
|
||||
TX_TRAINING310a = 13009;
|
||||
TX_TRAINING311a = 13010;
|
||||
TX_TRAINING401a = 14000;
|
||||
TX_TRAINING402a = 14001;
|
||||
TX_TRAINING403a = 14002;
|
||||
TX_TRAINING404a = 14003;
|
||||
TX_TRAINING405a = 14004;
|
||||
TX_TRAINING406a = 14005;
|
||||
TX_TRAINING407a = 14006;
|
||||
TX_TRAINING408a = 14007;
|
||||
TX_TRAINING409a = 14008;
|
||||
TX_TRAINING410a = 14009;
|
||||
resources = new Dictionary<int, string>();
|
||||
string text = CultureInfo.CurrentCulture.TwoLetterISOLanguageName.ToLower();
|
||||
string text2;
|
||||
if ((text2 = text) != null && text2 == "fr")
|
||||
{
|
||||
InitializeFR();
|
||||
}
|
||||
else
|
||||
{
|
||||
InitializeEN();
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFR()
|
||||
{
|
||||
resources.Add(TX_BUTTON_PLAY, "Jouer");
|
||||
resources.Add(TX_BUTTON_MENU, "Menu");
|
||||
resources.Add(TX_BUTTON_BACK, "Retour");
|
||||
resources.Add(TX_BUTTON_RESTART, "Recommencer");
|
||||
resources.Add(TX_BUTTON_CONTINUE, "Continuer");
|
||||
resources.Add(TX_BUTTON_BUY, "Acheter");
|
||||
resources.Add(TX_BUTTON_RANKING, "Classement");
|
||||
resources.Add(TX_BUTTON_SETUP, "Réglages");
|
||||
resources.Add(TX_BUTTON_SETUP_SOUNDS, "Bruitages");
|
||||
resources.Add(TX_BUTTON_SETUP_JUMP, "Bouton de saut à droite");
|
||||
resources.Add(TX_BUTTON_SETUP_ZOOM, "Zoom automatique sur l'action");
|
||||
resources.Add(TX_BUTTON_SETUP_ACCEL, "Accéléromètre");
|
||||
resources.Add(TX_BUTTON_SETUP_RESET, "Joueur {0} :\nEffacer la progression");
|
||||
resources.Add(TX_GAMER_TITLE, "Joueur {0}");
|
||||
resources.Add(TX_GAMER_MDOORS, "Portes principales : {0}/12");
|
||||
resources.Add(TX_GAMER_SDOORS, "Portes secondaires : {0}/52");
|
||||
resources.Add(TX_GAMER_LIFES, "Blupi : {0}");
|
||||
resources.Add(TX_TRIAL1, "Achetez la version complète");
|
||||
resources.Add(TX_TRIAL2, "\u000e 64 niveaux passionnants");
|
||||
resources.Add(TX_TRIAL3, "\u000e Des décors variés");
|
||||
resources.Add(TX_TRIAL4, "\u000e Une difficulté progressive");
|
||||
resources.Add(TX_TRIAL5, "\u000e De nouveaux pièges");
|
||||
resources.Add(TX_TRIAL6, "\u000e Un challenge fun");
|
||||
resources.Add(TX_TRAINING101, "Utilise la roue directionnelle \0.");
|
||||
resources.Add(TX_TRAINING102, "Appuie maintenant sur Saut \b.");
|
||||
resources.Add(TX_TRAINING103, "Appuie à droite sur la roue directionnelle \0 et sur Saut \b.");
|
||||
resources.Add(TX_TRAINING104, "Appuie sur Droite \0 et Saut \b.");
|
||||
resources.Add(TX_TRAINING105, "Essaie de ne pas te mouiller avec \0 \b !");
|
||||
resources.Add(TX_TRAINING106, "");
|
||||
resources.Add(TX_TRAINING107, "Prend l'ascenseur calmement, sans sauter \0.");
|
||||
resources.Add(TX_TRAINING108, "Saute sur l'ascenseur.");
|
||||
resources.Add(TX_TRAINING109, "");
|
||||
resources.Add(TX_TRAINING110, "Avance sans sauter et sans t'arrêter \0 !");
|
||||
resources.Add(TX_TRAINING111, "");
|
||||
resources.Add(TX_TRAINING112, "");
|
||||
resources.Add(TX_TRAINING113, "Avance sur la plateforme \0.");
|
||||
resources.Add(TX_TRAINING114, "Quitte la plateforme \0.");
|
||||
resources.Add(TX_TRAINING115, "Encore une fois, mais plus vite...");
|
||||
resources.Add(TX_TRAINING116, "Avance sur la plateforme \0 puis saute \0 \b.");
|
||||
resources.Add(TX_TRAINING117, "Saute lorsque tu es sur la plateforme \0 \b.");
|
||||
resources.Add(TX_TRAINING118, "Passe par en haut \0 \b.");
|
||||
resources.Add(TX_TRAINING119, "Les oeufs te redonnent des vies.");
|
||||
resources.Add(TX_TRAINING120, "Arrivé en haut, avance sur l'autre plateforme sans tarder...");
|
||||
resources.Add(TX_TRAINING121, "Attrape le deuxième et dernier trésor.");
|
||||
resources.Add(TX_TRAINING122, "Pour terminer, va sur la flèche rouge.");
|
||||
resources.Add(TX_TRAINING201, "Pousse la caisse sur le point rouge avec \0.");
|
||||
resources.Add(TX_TRAINING202, "Pratique, cette caisse, non ?");
|
||||
resources.Add(TX_TRAINING203, "Tire la caisse sur le point rouge avec \u0003.");
|
||||
resources.Add(TX_TRAINING204, "Empile les 2 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING205, "Empile 3 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING206, "");
|
||||
resources.Add(TX_TRAINING207, "");
|
||||
resources.Add(TX_TRAINING208, "");
|
||||
resources.Add(TX_TRAINING209, "");
|
||||
resources.Add(TX_TRAINING210, "");
|
||||
resources.Add(TX_TRAINING301, "Prend un hélico avec \t.");
|
||||
resources.Add(TX_TRAINING302, "Utilise \u0006 ou \b pour décoller. Dirige avec \u0004 et \0.");
|
||||
resources.Add(TX_TRAINING303, "Quitte l'hélico avec \t, il n'aime pas l'eau !");
|
||||
resources.Add(TX_TRAINING304, "Plonge. Utilise \u0004 \0 \u0002 \u0006 pour te diriger.");
|
||||
resources.Add(TX_TRAINING305, "Prend un hélico \t puis décole avec \u0006 ou \b.");
|
||||
resources.Add(TX_TRAINING306, "Attrape les 3 trésors puis monte.");
|
||||
resources.Add(TX_TRAINING307, "Pour passer, va chercher un skate en haut à gauche.");
|
||||
resources.Add(TX_TRAINING308, "Prend un skate avec \t.");
|
||||
resources.Add(TX_TRAINING309, "Tu peux passer sans crainte avec ton skate \0.");
|
||||
resources.Add(TX_TRAINING310, "Ton skate n'aime pas l'eau ! Utilise \0 \b.");
|
||||
resources.Add(TX_TRAINING311, "Pose ton skate avec \t.");
|
||||
resources.Add(TX_TRAINING401, "Prend la dynamite avec \t.");
|
||||
resources.Add(TX_TRAINING402, "Ne pose surtout pas la dynamite ici avec \t !");
|
||||
resources.Add(TX_TRAINING403, "Va chercher de la dynamite à gauche.");
|
||||
resources.Add(TX_TRAINING404, "Pose la dynamite avec \t, puis barre-toi !");
|
||||
resources.Add(TX_TRAINING405, "Pose encore de la dynamite pour passer.");
|
||||
resources.Add(TX_TRAINING406, "");
|
||||
resources.Add(TX_TRAINING407, "");
|
||||
resources.Add(TX_TRAINING408, "");
|
||||
resources.Add(TX_TRAINING409, "");
|
||||
resources.Add(TX_TRAINING410, "");
|
||||
resources.Add(TX_TRAINING101a, "Incline le téléphone à droite \v.");
|
||||
resources.Add(TX_TRAINING102a, "Appuie maintenant sur Saut \b.");
|
||||
resources.Add(TX_TRAINING103a, "\v et appuie sur Saut \b.");
|
||||
resources.Add(TX_TRAINING104a, "\v et Saut \b.");
|
||||
resources.Add(TX_TRAINING105a, "Essaie de ne pas te mouiller avec \v \b !");
|
||||
resources.Add(TX_TRAINING106a, "");
|
||||
resources.Add(TX_TRAINING107a, "Prend l'ascenseur calmement, sans sauter \v.");
|
||||
resources.Add(TX_TRAINING108a, "Saute sur l'ascenseur.");
|
||||
resources.Add(TX_TRAINING109a, "");
|
||||
resources.Add(TX_TRAINING110a, "Avance sans sauter et sans t'arrêter \v !");
|
||||
resources.Add(TX_TRAINING111a, "");
|
||||
resources.Add(TX_TRAINING112a, "");
|
||||
resources.Add(TX_TRAINING113a, "Avance sur la plateforme \v.");
|
||||
resources.Add(TX_TRAINING114a, "Quitte la plateforme \v.");
|
||||
resources.Add(TX_TRAINING115a, "Encore une fois, mais plus vite...");
|
||||
resources.Add(TX_TRAINING116a, "Avance sur la plateforme \v puis saute \v \b.");
|
||||
resources.Add(TX_TRAINING117a, "Saute lorsque tu es sur la plateforme \v \b.");
|
||||
resources.Add(TX_TRAINING118a, "Passe par en haut \v \b.");
|
||||
resources.Add(TX_TRAINING119a, "Les oeufs te redonnent des vies.");
|
||||
resources.Add(TX_TRAINING120a, "Arrivé en haut, avance sur l'autre plateforme sans tarder...");
|
||||
resources.Add(TX_TRAINING121a, "Attrape le deuxième et dernier trésor.");
|
||||
resources.Add(TX_TRAINING122a, "Pour terminer, va sur la flèche rouge.");
|
||||
resources.Add(TX_TRAINING201a, "Pousse la caisse sur le point rouge avec \v.");
|
||||
resources.Add(TX_TRAINING202a, "Pratique, cette caisse, non ?");
|
||||
resources.Add(TX_TRAINING203a, "Tire la caisse sur le point rouge avec \f et \n.");
|
||||
resources.Add(TX_TRAINING204a, "Empile les 2 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING205a, "Empile 3 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING206a, "");
|
||||
resources.Add(TX_TRAINING207a, "");
|
||||
resources.Add(TX_TRAINING208a, "");
|
||||
resources.Add(TX_TRAINING209a, "");
|
||||
resources.Add(TX_TRAINING210a, "");
|
||||
resources.Add(TX_TRAINING301a, "Prend un hélico avec \t.");
|
||||
resources.Add(TX_TRAINING302a, "Utilise \b pour décoller. Dirige avec \f et \v.");
|
||||
resources.Add(TX_TRAINING303a, "Quitte l'hélico avec \t, il n'aime pas l'eau !");
|
||||
resources.Add(TX_TRAINING304a, "Plonge. Utilise \f \v \b \n pour te diriger.");
|
||||
resources.Add(TX_TRAINING305a, "Prend un hélico \t puis décole avec \b.");
|
||||
resources.Add(TX_TRAINING306a, "Attrape les 3 trésors puis monte.");
|
||||
resources.Add(TX_TRAINING307a, "Pour passer, va chercher un skate en haut à gauche.");
|
||||
resources.Add(TX_TRAINING308a, "Prend un skate avec \t.");
|
||||
resources.Add(TX_TRAINING309a, "Tu peux passer sans crainte avec ton skate \v.");
|
||||
resources.Add(TX_TRAINING310a, "Ton skate n'aime pas l'eau ! Utilise \v \b.");
|
||||
resources.Add(TX_TRAINING311a, "Pose ton skate avec \t.");
|
||||
resources.Add(TX_TRAINING401a, "Prend la dynamite avec \t.");
|
||||
resources.Add(TX_TRAINING402a, "Ne pose surtout pas la dynamite ici avec \t !");
|
||||
resources.Add(TX_TRAINING403a, "Va chercher de la dynamite à gauche.");
|
||||
resources.Add(TX_TRAINING404a, "Pose la dynamite avec \t, puis barre-toi !");
|
||||
resources.Add(TX_TRAINING405a, "Pose encore de la dynamite pour passer.");
|
||||
resources.Add(TX_TRAINING406a, "");
|
||||
resources.Add(TX_TRAINING407a, "");
|
||||
resources.Add(TX_TRAINING408a, "");
|
||||
resources.Add(TX_TRAINING409a, "");
|
||||
resources.Add(TX_TRAINING410a, "");
|
||||
}
|
||||
|
||||
private static void InitializeEN()
|
||||
{
|
||||
resources.Add(TX_BUTTON_PLAY, "Play");
|
||||
resources.Add(TX_BUTTON_MENU, "Home");
|
||||
resources.Add(TX_BUTTON_BACK, "Back");
|
||||
resources.Add(TX_BUTTON_RESTART, "Restart");
|
||||
resources.Add(TX_BUTTON_CONTINUE, "Continue");
|
||||
resources.Add(TX_BUTTON_BUY, "Buy");
|
||||
resources.Add(TX_BUTTON_RANKING, "Ranking");
|
||||
resources.Add(TX_BUTTON_SETUP, "Setup");
|
||||
resources.Add(TX_BUTTON_SETUP_SOUNDS, "Sound effects");
|
||||
resources.Add(TX_BUTTON_SETUP_JUMP, "Jump button on the right");
|
||||
resources.Add(TX_BUTTON_SETUP_ZOOM, "Automatic zoom on action");
|
||||
resources.Add(TX_BUTTON_SETUP_ACCEL, "Accelerometer");
|
||||
resources.Add(TX_BUTTON_SETUP_RESET, "Player {0} :\nErase progress");
|
||||
resources.Add(TX_GAMER_TITLE, "Player {0}");
|
||||
resources.Add(TX_GAMER_MDOORS, "Main gates : {0}/12");
|
||||
resources.Add(TX_GAMER_SDOORS, "Secondary gates : {0}/52");
|
||||
resources.Add(TX_GAMER_LIFES, "Blupi : {0}");
|
||||
resources.Add(TX_TRIAL1, "Buy the full version");
|
||||
resources.Add(TX_TRIAL2, "\u000e 64 exciting stages");
|
||||
resources.Add(TX_TRIAL3, "\u000e Varied backgrounds");
|
||||
resources.Add(TX_TRIAL4, "\u000e An increasing difficulty");
|
||||
resources.Add(TX_TRIAL5, "\u000e New traps");
|
||||
resources.Add(TX_TRIAL6, "\u000e Challenge and fun");
|
||||
resources.Add(TX_TRAINING101, "Use the directional wheel \0.");
|
||||
resources.Add(TX_TRAINING102, "Press Jump \b.");
|
||||
resources.Add(TX_TRAINING103, "Press Right \0 and Jump \b.");
|
||||
resources.Add(TX_TRAINING104, "Press Right \0 and Jump \b.");
|
||||
resources.Add(TX_TRAINING105, "Don't fall into the water \0 \b !");
|
||||
resources.Add(TX_TRAINING106, "");
|
||||
resources.Add(TX_TRAINING107, "Take the elevator quietly, without jumping \0.");
|
||||
resources.Add(TX_TRAINING108, "Jump on the elevator.");
|
||||
resources.Add(TX_TRAINING109, "");
|
||||
resources.Add(TX_TRAINING110, "Move forward without jumping nor stopping \0 !");
|
||||
resources.Add(TX_TRAINING111, "");
|
||||
resources.Add(TX_TRAINING112, "");
|
||||
resources.Add(TX_TRAINING113, "Move forward on the platform \0.");
|
||||
resources.Add(TX_TRAINING114, "Leave the platform \0.");
|
||||
resources.Add(TX_TRAINING115, "Once again, but faster...");
|
||||
resources.Add(TX_TRAINING116, "Move forward on the platform \0, then jump \0 \b.");
|
||||
resources.Add(TX_TRAINING117, "Jump when you are on the platform \0 \b.");
|
||||
resources.Add(TX_TRAINING118, "Choose the upper path \0 \b.");
|
||||
resources.Add(TX_TRAINING119, "Eggs give you extra lives.");
|
||||
resources.Add(TX_TRAINING120, "Once on the top, move forward on the other platform without delay...");
|
||||
resources.Add(TX_TRAINING121, "Catch the second and last treasure.");
|
||||
resources.Add(TX_TRAINING122, "Join the red arrow.");
|
||||
resources.Add(TX_TRAINING201, "Push the box forward until the red dot with \0.");
|
||||
resources.Add(TX_TRAINING202, "Practical, right?");
|
||||
resources.Add(TX_TRAINING203, "Pull the box backward until the red dot with \u0003.");
|
||||
resources.Add(TX_TRAINING204, "Stack both boxes up on the red dot to move on.");
|
||||
resources.Add(TX_TRAINING205, "Stack the three boxes up on the red dot to move on.");
|
||||
resources.Add(TX_TRAINING206, "");
|
||||
resources.Add(TX_TRAINING207, "");
|
||||
resources.Add(TX_TRAINING208, "");
|
||||
resources.Add(TX_TRAINING209, "");
|
||||
resources.Add(TX_TRAINING210, "");
|
||||
resources.Add(TX_TRAINING301, "Take a helicopter with \t.");
|
||||
resources.Add(TX_TRAINING302, "Use \u0006 or \b to take off. Direct with \u0004 and \0.");
|
||||
resources.Add(TX_TRAINING303, "Leave the helicopter with \t, it dislikes water!");
|
||||
resources.Add(TX_TRAINING304, "Plunge. Use \u0004 \0 \u0002 \u0006 to direct.");
|
||||
resources.Add(TX_TRAINING305, "Take a helicopter \t then take off with \u0006 or \b.");
|
||||
resources.Add(TX_TRAINING306, "Grab the three treasures, then go up.");
|
||||
resources.Add(TX_TRAINING307, "Go and get a skate in the top left corner.");
|
||||
resources.Add(TX_TRAINING308, "Take a skate with \t.");
|
||||
resources.Add(TX_TRAINING309, "You can move on with your skate without fear \0.");
|
||||
resources.Add(TX_TRAINING310, "Your skate dislikes water! Jump!");
|
||||
resources.Add(TX_TRAINING311, "Leave your skate with \t.");
|
||||
resources.Add(TX_TRAINING401, "Take the dynamite sticks with \t.");
|
||||
resources.Add(TX_TRAINING402, "Do not put down the dynamite here!");
|
||||
resources.Add(TX_TRAINING403, "Go and get the dynamite sticks on the left.");
|
||||
resources.Add(TX_TRAINING404, "Put down the dynamite with \t, then clear off!");
|
||||
resources.Add(TX_TRAINING405, "Put down another stick of dynamite here to move on.");
|
||||
resources.Add(TX_TRAINING406, "");
|
||||
resources.Add(TX_TRAINING407, "");
|
||||
resources.Add(TX_TRAINING408, "");
|
||||
resources.Add(TX_TRAINING409, "");
|
||||
resources.Add(TX_TRAINING410, "");
|
||||
resources.Add(TX_TRAINING101a, "Tilt the phone \v.");
|
||||
resources.Add(TX_TRAINING102a, "Press Jump \b.");
|
||||
resources.Add(TX_TRAINING103a, "\v and Jump \b.");
|
||||
resources.Add(TX_TRAINING104a, "\v and Jump \b.");
|
||||
resources.Add(TX_TRAINING105a, "Don't fall into the water \v \b !");
|
||||
resources.Add(TX_TRAINING106a, "");
|
||||
resources.Add(TX_TRAINING107a, "Take the elevator quietly, without jumping \v.");
|
||||
resources.Add(TX_TRAINING108a, "Jump on the elevator.");
|
||||
resources.Add(TX_TRAINING109a, "");
|
||||
resources.Add(TX_TRAINING110a, "Move forward without jumping nor stopping \v !");
|
||||
resources.Add(TX_TRAINING111a, "");
|
||||
resources.Add(TX_TRAINING112a, "");
|
||||
resources.Add(TX_TRAINING113a, "Move forward on the platform \v.");
|
||||
resources.Add(TX_TRAINING114a, "Leave the platform \v.");
|
||||
resources.Add(TX_TRAINING115a, "Once again, but faster...");
|
||||
resources.Add(TX_TRAINING116a, "Move forward on the platform \v, then jump \v \b.");
|
||||
resources.Add(TX_TRAINING117a, "Jump when you are on the platform \v \b.");
|
||||
resources.Add(TX_TRAINING118a, "Choose the upper path \v \b.");
|
||||
resources.Add(TX_TRAINING119a, "Eggs give you extra lives.");
|
||||
resources.Add(TX_TRAINING120a, "Once on the top, move forward on the other platform without delay...");
|
||||
resources.Add(TX_TRAINING121a, "Catch the second and last treasure.");
|
||||
resources.Add(TX_TRAINING122a, "Join the red arrow.");
|
||||
resources.Add(TX_TRAINING201a, "Push the box forward until the red dot with \v.");
|
||||
resources.Add(TX_TRAINING202a, "Practical, right?");
|
||||
resources.Add(TX_TRAINING203a, "Pull the box backward until the red dot with \f and \n.");
|
||||
resources.Add(TX_TRAINING204a, "Stack both boxes up on the red dot to move on.");
|
||||
resources.Add(TX_TRAINING205a, "Stack the three boxes up on the red dot to move on.");
|
||||
resources.Add(TX_TRAINING206a, "");
|
||||
resources.Add(TX_TRAINING207a, "");
|
||||
resources.Add(TX_TRAINING208a, "");
|
||||
resources.Add(TX_TRAINING209a, "");
|
||||
resources.Add(TX_TRAINING210a, "");
|
||||
resources.Add(TX_TRAINING301a, "Take a helicopter with \t.");
|
||||
resources.Add(TX_TRAINING302a, "Use \b to take off. Direct with \f and \v.");
|
||||
resources.Add(TX_TRAINING303a, "Leave the helicopter with \t, it dislikes water!");
|
||||
resources.Add(TX_TRAINING304a, "Plunge. Use \f \v \b \n to direct.");
|
||||
resources.Add(TX_TRAINING305a, "Take a helicopter \t then take off with \b.");
|
||||
resources.Add(TX_TRAINING306a, "Grab the three treasures, then go up.");
|
||||
resources.Add(TX_TRAINING307a, "Go and get a skate in the top left corner.");
|
||||
resources.Add(TX_TRAINING308a, "Take a skate with \t.");
|
||||
resources.Add(TX_TRAINING309a, "You can move on with your skate without fear \v.");
|
||||
resources.Add(TX_TRAINING310a, "Your skate dislikes water! Jump!");
|
||||
resources.Add(TX_TRAINING311a, "Leave your skate with \t.");
|
||||
resources.Add(TX_TRAINING401a, "Take the dynamite sticks with \t.");
|
||||
resources.Add(TX_TRAINING402a, "Do not put down the dynamite here!");
|
||||
resources.Add(TX_TRAINING403a, "Go and get the dynamite sticks on the left.");
|
||||
resources.Add(TX_TRAINING404a, "Put down the dynamite with \t, then clear off!");
|
||||
resources.Add(TX_TRAINING405a, "Put down another stick of dynamite here to move on.");
|
||||
resources.Add(TX_TRAINING406a, "");
|
||||
resources.Add(TX_TRAINING407a, "");
|
||||
resources.Add(TX_TRAINING408a, "");
|
||||
resources.Add(TX_TRAINING409a, "");
|
||||
resources.Add(TX_TRAINING410a, "");
|
||||
}
|
||||
|
||||
private static void InitializeDE()
|
||||
{
|
||||
resources.Add(TX_BUTTON_PLAY, "Play");
|
||||
resources.Add(TX_BUTTON_MENU, "Home");
|
||||
resources.Add(TX_BUTTON_BACK, "Back");
|
||||
resources.Add(TX_BUTTON_RESTART, "Restart");
|
||||
resources.Add(TX_BUTTON_CONTINUE, "Continue");
|
||||
resources.Add(TX_BUTTON_BUY, "Buy");
|
||||
resources.Add(TX_BUTTON_RANKING, "Ranking");
|
||||
resources.Add(TX_BUTTON_SETUP, "Setup");
|
||||
resources.Add(TX_BUTTON_SETUP_SOUNDS, "Sounds");
|
||||
resources.Add(TX_BUTTON_SETUP_JUMP, "Jump button to the right");
|
||||
resources.Add(TX_BUTTON_SETUP_ZOOM, "Automatically zoom action");
|
||||
resources.Add(TX_BUTTON_SETUP_ACCEL, "Accelerometer");
|
||||
resources.Add(TX_BUTTON_SETUP_RESET, "Gamer {0} :\nReset progression");
|
||||
resources.Add(TX_GAMER_TITLE, "Gamer {0}");
|
||||
resources.Add(TX_GAMER_MDOORS, "Main doors : {0}/12");
|
||||
resources.Add(TX_GAMER_SDOORS, "Secondary doors : {0}/52");
|
||||
resources.Add(TX_GAMER_LIFES, "Blupi : {0}");
|
||||
resources.Add(TX_TRIAL1, "Buy the full version");
|
||||
resources.Add(TX_TRIAL2, "\u000e 64 niveaux passionnants");
|
||||
resources.Add(TX_TRIAL3, "\u000e Des décors variés");
|
||||
resources.Add(TX_TRIAL4, "\u000e Une difficulté progressive");
|
||||
resources.Add(TX_TRIAL5, "\u000e De nouveaux pièges");
|
||||
resources.Add(TX_TRIAL6, "\u000e Un challenge fun");
|
||||
resources.Add(TX_TRAINING101, "Utilise la roue directionnelle \0 pour faire avancer Blupi.");
|
||||
resources.Add(TX_TRAINING102, "Appuie maintenant sur le bouton de saut \b.");
|
||||
resources.Add(TX_TRAINING103, "Appuie à droite sur la roue directionnelle \0 et sur Saut \b.");
|
||||
resources.Add(TX_TRAINING104, "Appuie sur Droite \0 et Saut \b.");
|
||||
resources.Add(TX_TRAINING105, "Essaie de ne pas te mouiller avec \0 \b !");
|
||||
resources.Add(TX_TRAINING106, "");
|
||||
resources.Add(TX_TRAINING107, "Prend l'ascenseur calmement, sans sauter \0.");
|
||||
resources.Add(TX_TRAINING108, "Saute sur l'ascenseur.");
|
||||
resources.Add(TX_TRAINING109, "");
|
||||
resources.Add(TX_TRAINING110, "Avance sans sauter et sans t'arrêter \0 !");
|
||||
resources.Add(TX_TRAINING111, "");
|
||||
resources.Add(TX_TRAINING112, "");
|
||||
resources.Add(TX_TRAINING113, "Avance sur la plateforme \0.");
|
||||
resources.Add(TX_TRAINING114, "Quitte la plateforme \0.");
|
||||
resources.Add(TX_TRAINING115, "Encore une fois, mais plus vite...");
|
||||
resources.Add(TX_TRAINING116, "Avance sur la plateforme \0 puis saute \0 \b.");
|
||||
resources.Add(TX_TRAINING117, "Saute lorsque tu es sur la plateforme \0 \b.");
|
||||
resources.Add(TX_TRAINING118, "Passe par en haut \0 \b.");
|
||||
resources.Add(TX_TRAINING119, "Les oeufs te redonnent des vies.");
|
||||
resources.Add(TX_TRAINING120, "Arrivé en haut, avance sur l'autre plateforme sans tarder...");
|
||||
resources.Add(TX_TRAINING121, "Attrape le deuxième et dernier trésor.");
|
||||
resources.Add(TX_TRAINING122, "Pour terminer, va sur la flèche rouge.");
|
||||
resources.Add(TX_TRAINING201, "Pousse la caisse sur le point rouge avec \0.");
|
||||
resources.Add(TX_TRAINING202, "Utilise la caisse pour passer l'obstacle avec \0 \b.");
|
||||
resources.Add(TX_TRAINING203, "Tire la caisse sur le point rouge avec \u0003.");
|
||||
resources.Add(TX_TRAINING204, "Empile les 2 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING205, "Empile 3 caisses sur le point rouge pour passer.");
|
||||
resources.Add(TX_TRAINING206, "");
|
||||
resources.Add(TX_TRAINING207, "");
|
||||
resources.Add(TX_TRAINING208, "");
|
||||
resources.Add(TX_TRAINING209, "");
|
||||
resources.Add(TX_TRAINING210, "");
|
||||
resources.Add(TX_TRAINING301, "Prend un hélico avec \t.");
|
||||
resources.Add(TX_TRAINING302, "Utilise \u0006 ou \b pour décoler. Dirige avec \u0004 et \0.");
|
||||
resources.Add(TX_TRAINING303, "Quitte l'hélico avec \t, il n'aime pas l'eau !");
|
||||
resources.Add(TX_TRAINING304, "Plonge. Utilise \u0004 \0 \u0002 \u0006 pour te diriger.");
|
||||
resources.Add(TX_TRAINING305, "Prend un hélico \t puis décole avec \u0006 ou \b.");
|
||||
resources.Add(TX_TRAINING306, "Attrape les 3 trésors puis monte.");
|
||||
resources.Add(TX_TRAINING307, "Pour passer, va chercher un skate en haut à gauche.");
|
||||
resources.Add(TX_TRAINING308, "Prend un skate avec \t.");
|
||||
resources.Add(TX_TRAINING309, "Tu peux passer sans crainte avec ton skate \0.");
|
||||
resources.Add(TX_TRAINING310, "Ton skate n'aime pas l'eau ! Utilise \0 \b.");
|
||||
resources.Add(TX_TRAINING311, "Pose ton skate avec \t.");
|
||||
resources.Add(TX_TRAINING401, "Prend la dynamite avec \t.");
|
||||
resources.Add(TX_TRAINING402, "Ne pose surtout pas la dynamite ici avec \t !");
|
||||
resources.Add(TX_TRAINING403, "Va chercher de la dynamite à gauche.");
|
||||
resources.Add(TX_TRAINING404, "Pose la dynamite avec \t, puis barre-toi !");
|
||||
resources.Add(TX_TRAINING405, "Pose encore de la dynamite pour passer.");
|
||||
resources.Add(TX_TRAINING406, "");
|
||||
resources.Add(TX_TRAINING407, "");
|
||||
resources.Add(TX_TRAINING408, "");
|
||||
resources.Add(TX_TRAINING409, "");
|
||||
resources.Add(TX_TRAINING410, "");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,575 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Pixmap
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using static WindowsPhoneSpeedyBlupi.Def;
|
||||
using static WindowsPhoneSpeedyBlupi.Xna;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Pixmap
|
||||
{
|
||||
private readonly Game1 game1;
|
||||
|
||||
private readonly GraphicsDeviceManager graphics;
|
||||
|
||||
private double zoom;
|
||||
|
||||
private double originX;
|
||||
|
||||
private double originY;
|
||||
|
||||
private double hotSpotZoom;
|
||||
|
||||
private double hotSpotX;
|
||||
|
||||
private double hotSpotY;
|
||||
|
||||
private SpriteBatch spriteBatch;
|
||||
|
||||
private Texture2D bitmapText;
|
||||
|
||||
private Texture2D bitmapButton;
|
||||
|
||||
private Texture2D bitmapJauge;
|
||||
|
||||
private Texture2D bitmapBlupi;
|
||||
|
||||
private Texture2D bitmapBlupi1;
|
||||
|
||||
private Texture2D bitmapObject;
|
||||
|
||||
private Texture2D bitmapElement;
|
||||
|
||||
private Texture2D bitmapExplo;
|
||||
|
||||
private Texture2D bitmapPad;
|
||||
|
||||
private Texture2D bitmapSpeedyBlupi;
|
||||
|
||||
private Texture2D bitmapBlupiYoupie;
|
||||
|
||||
private Texture2D bitmapGear;
|
||||
|
||||
private Texture2D bitmapBackground;
|
||||
|
||||
private Vector2 origin;
|
||||
|
||||
private SpriteEffects effect;
|
||||
|
||||
public TinyRect DrawBounds
|
||||
{
|
||||
get
|
||||
{
|
||||
TinyRect result = default(TinyRect);
|
||||
double screenWidth = graphics.GraphicsDevice.Viewport.Width;
|
||||
double screenHeight = graphics.GraphicsDevice.Viewport.Height;
|
||||
if(Env.PLATFORM == Platform.Android && screenHeight > 480) {
|
||||
screenWidth = screenHeight * (640f / 480f);
|
||||
}
|
||||
if (screenWidth != 0.0 && screenHeight != 0.0)
|
||||
{
|
||||
double num3;
|
||||
double num4;
|
||||
if (screenWidth / screenHeight < 1.3333333333333333)
|
||||
{
|
||||
num3 = 640.0;
|
||||
num4 = 640.0 * (screenHeight / screenWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
num3 = 480.0 * (screenWidth / screenHeight);
|
||||
num4 = 480.0;
|
||||
}
|
||||
result.LeftX = 0;
|
||||
result.RightX = (int)num3;
|
||||
result.TopY = 0;
|
||||
result.BottomY = (int)num4;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public TinyPoint Origin
|
||||
{
|
||||
get
|
||||
{
|
||||
TinyPoint result = default(TinyPoint);
|
||||
result.X = (int)originX;
|
||||
result.Y = (int)originY;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public Pixmap(Game1 game1, GraphicsDeviceManager graphics)
|
||||
{
|
||||
this.game1 = game1;
|
||||
this.graphics = graphics;
|
||||
origin = new Vector2(0f, 0f);
|
||||
effect = SpriteEffects.None;
|
||||
}
|
||||
|
||||
public TinyPoint HotSpotToHud(TinyPoint pos)
|
||||
{
|
||||
TinyPoint result = default(TinyPoint);
|
||||
result.X = (int)((double)(pos.X - (int)hotSpotX) / hotSpotZoom) + (int)hotSpotX - (int)originX;
|
||||
result.Y = (int)((double)(pos.Y - (int)hotSpotY) / hotSpotZoom) + (int)hotSpotY - (int)originY;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SetHotSpot(double zoom, double x, double y)
|
||||
{
|
||||
hotSpotZoom = zoom;
|
||||
hotSpotX = x;
|
||||
hotSpotY = y;
|
||||
}
|
||||
|
||||
public void DrawInputButton(TinyRect rect, Def.ButtonGlyph glyph, bool pressed, bool selected)
|
||||
{
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlyph.InitGamerA:
|
||||
DrawIcon(14, selected ? 16 : 4, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitGamerB:
|
||||
DrawIcon(14, selected ? 17 : 5, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitGamerC:
|
||||
DrawIcon(14, selected ? 18 : 6, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitSetup:
|
||||
case Def.ButtonGlyph.PauseSetup:
|
||||
DrawIcon(14, 19, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitPlay:
|
||||
DrawIcon(14, 7, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PauseMenu:
|
||||
case Def.ButtonGlyph.ResumeMenu:
|
||||
DrawIcon(14, 11, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PauseBack:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PauseRestart:
|
||||
DrawIcon(14, 9, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PauseContinue:
|
||||
case Def.ButtonGlyph.ResumeContinue:
|
||||
DrawIcon(14, 10, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.WinLostReturn:
|
||||
DrawIcon(14, 3, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitBuy:
|
||||
case Def.ButtonGlyph.TrialBuy:
|
||||
DrawIcon(14, 22, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.InitRanking:
|
||||
DrawIcon(14, 12, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.TrialCancel:
|
||||
case Def.ButtonGlyph.RankingContinue:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.SetupSounds:
|
||||
case Def.ButtonGlyph.SetupJump:
|
||||
case Def.ButtonGlyph.SetupZoom:
|
||||
case Def.ButtonGlyph.SetupAccel:
|
||||
DrawIcon(14, selected ? 13 : 21, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.SetupReset:
|
||||
DrawIcon(14, 20, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.SetupReturn:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PlayJump:
|
||||
DrawIcon(14, 2, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PlayAction:
|
||||
DrawIcon(14, 12, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PlayDown:
|
||||
DrawIcon(14, 23, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.PlayPause:
|
||||
DrawIcon(14, 3, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlyph.Cheat1:
|
||||
case Def.ButtonGlyph.Cheat2:
|
||||
case Def.ButtonGlyph.Cheat3:
|
||||
case Def.ButtonGlyph.Cheat4:
|
||||
case Def.ButtonGlyph.Cheat5:
|
||||
case Def.ButtonGlyph.Cheat6:
|
||||
case Def.ButtonGlyph.Cheat7:
|
||||
case Def.ButtonGlyph.Cheat8:
|
||||
case Def.ButtonGlyph.Cheat9:
|
||||
{
|
||||
DrawIcon(14, 0, rect, pressed ? 0.6 : 1.0, false);
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = rect.LeftX + rect.Width / 2 - (int)originX;
|
||||
tinyPoint.Y = rect.TopY + 28;
|
||||
TinyPoint pos = tinyPoint;
|
||||
Text.DrawTextCenter(this, pos, Decor.GetCheatTinyText(glyph), 1.0);
|
||||
break;
|
||||
}
|
||||
case Def.ButtonGlyph.Cheat11:
|
||||
case Def.ButtonGlyph.Cheat12:
|
||||
case Def.ButtonGlyph.Cheat21:
|
||||
case Def.ButtonGlyph.Cheat22:
|
||||
case Def.ButtonGlyph.Cheat31:
|
||||
case Def.ButtonGlyph.Cheat32:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadContent()
|
||||
{
|
||||
spriteBatch = new SpriteBatch(game1.GraphicsDevice);
|
||||
bitmapText = game1.Content.Load<Texture2D>("icons/text");
|
||||
bitmapButton = game1.Content.Load<Texture2D>("icons/button");
|
||||
bitmapJauge = game1.Content.Load<Texture2D>("icons/jauge");
|
||||
bitmapBlupi = game1.Content.Load<Texture2D>("icons/blupi");
|
||||
bitmapBlupi1 = game1.Content.Load<Texture2D>("icons/blupi1");
|
||||
bitmapObject = game1.Content.Load<Texture2D>("icons/object-m");
|
||||
bitmapElement = game1.Content.Load<Texture2D>("icons/element");
|
||||
bitmapExplo = game1.Content.Load<Texture2D>("icons/explo");
|
||||
bitmapPad = game1.Content.Load<Texture2D>("icons/pad");
|
||||
bitmapSpeedyBlupi = game1.Content.Load<Texture2D>("backgrounds/speedyblupi");
|
||||
bitmapBlupiYoupie = game1.Content.Load<Texture2D>("backgrounds/blupiyoupie");
|
||||
bitmapGear = game1.Content.Load<Texture2D>("backgrounds/gear");
|
||||
UpdateGeometry();
|
||||
}
|
||||
|
||||
private void UpdateGeometry()
|
||||
{
|
||||
double screenWidth = graphics.GraphicsDevice.Viewport.Width;
|
||||
double screenHeight = graphics.GraphicsDevice.Viewport.Height;
|
||||
if (Env.PLATFORM == Platform.Android && screenHeight > 480)
|
||||
{
|
||||
screenWidth = screenHeight * (640f / 480f);
|
||||
}
|
||||
double val = screenWidth / 640.0;
|
||||
double val2 = screenHeight / 480.0;
|
||||
zoom = Math.Min(val, val2);
|
||||
originX = (screenWidth - 640.0 * zoom) / 2.0;
|
||||
originY = (screenHeight - 480.0 * zoom) / 2.0;
|
||||
}
|
||||
|
||||
public void BackgroundCache(string name)
|
||||
{
|
||||
bitmapBackground = game1.Content.Load<Texture2D>("backgrounds/" + name);
|
||||
}
|
||||
|
||||
public bool Start()
|
||||
{
|
||||
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Finish()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DrawBackground()
|
||||
{
|
||||
double screenWidth = graphics.GraphicsDevice.Viewport.Width;
|
||||
double screenHeight = graphics.GraphicsDevice.Viewport.Height;
|
||||
if (Env.PLATFORM == Platform.Android && screenHeight > 480)
|
||||
{
|
||||
screenWidth = screenHeight * (640f / 480f);
|
||||
}
|
||||
Texture2D bitmap = GetBitmap(3);
|
||||
Rectangle srcRectangle = GetSrcRectangle(bitmap, 10, 10, 10, 10, 0, 0);
|
||||
Rectangle destinationRectangle = new Rectangle(0, 0, (int)screenWidth, (int)screenHeight);
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
|
||||
spriteBatch.Draw(bitmap, destinationRectangle, srcRectangle, Color.White);
|
||||
spriteBatch.End();
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = (int)originX;
|
||||
tinyPoint.Y = (int)originY;
|
||||
TinyPoint dest = tinyPoint;
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = 0;
|
||||
tinyRect.TopY = 0;
|
||||
tinyRect.RightX = 640;
|
||||
tinyRect.BottomY = 480;
|
||||
TinyRect rect = tinyRect;
|
||||
DrawPart(3, dest, rect);
|
||||
}
|
||||
|
||||
public void DrawChar(int rank, TinyPoint pos, double size)
|
||||
{
|
||||
pos.X = (int)((double)pos.X + originX);
|
||||
pos.Y = (int)((double)pos.Y + originY);
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = pos.X;
|
||||
tinyRect.TopY = pos.Y;
|
||||
tinyRect.RightX = pos.X + (int)(32.0 * size);
|
||||
tinyRect.BottomY = pos.Y + (int)(32.0 * size);
|
||||
TinyRect rect = tinyRect;
|
||||
DrawIcon(6, rank, rect, 1.0, false);
|
||||
}
|
||||
|
||||
public void HudIcon(int channel, int rank, TinyPoint pos)
|
||||
{
|
||||
pos.X = (int)((double)pos.X + originX);
|
||||
pos.Y = (int)((double)pos.Y + originY);
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = pos.X;
|
||||
tinyRect.TopY = pos.Y;
|
||||
tinyRect.RightX = pos.X;
|
||||
tinyRect.BottomY = pos.Y;
|
||||
TinyRect rect = tinyRect;
|
||||
DrawIcon(channel, rank, rect, 1.0, false);
|
||||
}
|
||||
|
||||
public void QuickIcon(int channel, int rank, TinyPoint pos)
|
||||
{
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = pos.X;
|
||||
tinyRect.TopY = pos.Y;
|
||||
tinyRect.RightX = pos.X;
|
||||
tinyRect.BottomY = pos.Y;
|
||||
TinyRect rect = tinyRect;
|
||||
DrawIcon(channel, rank, rect, 1.0, true);
|
||||
}
|
||||
|
||||
public void QuickIcon(int channel, int rank, TinyPoint pos, double opacity, double rotation)
|
||||
{
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = pos.X;
|
||||
tinyRect.TopY = pos.Y;
|
||||
tinyRect.RightX = pos.X;
|
||||
tinyRect.BottomY = pos.Y;
|
||||
TinyRect rect = tinyRect;
|
||||
DrawIcon(channel, rank, rect, opacity, rotation, true);
|
||||
}
|
||||
|
||||
public bool DrawPart(int channel, TinyPoint dest, TinyRect rect)
|
||||
{
|
||||
return DrawPart(channel, dest, rect, 1.0);
|
||||
}
|
||||
|
||||
public bool DrawPart(int channel, TinyPoint dest, TinyRect rect, double zoom)
|
||||
{
|
||||
Texture2D bitmap = GetBitmap(channel);
|
||||
if (bitmap == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (channel == 5)
|
||||
{
|
||||
dest.X = (int)((double)dest.X + originX);
|
||||
dest.Y = (int)((double)dest.Y + originY);
|
||||
}
|
||||
Rectangle value = new Rectangle(rect.LeftX, rect.TopY, rect.Width, rect.Height);
|
||||
Rectangle destinationRectangle = new Rectangle(dest.X, dest.Y, (int)((double)rect.Width * zoom), (int)((double)rect.Height * zoom));
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
|
||||
spriteBatch.Draw(bitmap, destinationRectangle, value, Color.White);
|
||||
spriteBatch.End();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DrawIcon(int channel, int icon, TinyRect rect, double opacity, bool useHotSpot)
|
||||
{
|
||||
DrawIcon(channel, icon, rect, opacity, 0.0, useHotSpot);
|
||||
}
|
||||
|
||||
public void DrawIcon(int channel, int icon, TinyRect rect, double opacity, double rotation, bool useHotSpot)
|
||||
{
|
||||
if (icon == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Texture2D bitmap = GetBitmap(channel);
|
||||
if (bitmap == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num;
|
||||
int bitmapGridY;
|
||||
int iconWidth;
|
||||
int num2;
|
||||
int gap;
|
||||
switch (channel)
|
||||
{
|
||||
case 2:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
num = 60;
|
||||
bitmapGridY = 60;
|
||||
iconWidth = 60;
|
||||
num2 = 60;
|
||||
gap = 0;
|
||||
break;
|
||||
case 1:
|
||||
num = 64;
|
||||
bitmapGridY = 64;
|
||||
iconWidth = 64;
|
||||
num2 = 64;
|
||||
gap = 1;
|
||||
break;
|
||||
case 10:
|
||||
num = 60;
|
||||
bitmapGridY = 60;
|
||||
iconWidth = 60;
|
||||
num2 = 60;
|
||||
gap = 0;
|
||||
break;
|
||||
case 9:
|
||||
num = 144;
|
||||
bitmapGridY = 144;
|
||||
num2 = Tables.table_explo_size[icon];
|
||||
iconWidth = Math.Max(num2, 128);
|
||||
gap = 0;
|
||||
break;
|
||||
case 6:
|
||||
num = 32;
|
||||
bitmapGridY = 32;
|
||||
iconWidth = 32;
|
||||
num2 = 32;
|
||||
gap = 0;
|
||||
break;
|
||||
case 4:
|
||||
num = 40;
|
||||
bitmapGridY = 40;
|
||||
iconWidth = 40;
|
||||
num2 = 40;
|
||||
gap = 0;
|
||||
break;
|
||||
case 14:
|
||||
num = 140;
|
||||
bitmapGridY = 140;
|
||||
iconWidth = 140;
|
||||
num2 = 140;
|
||||
gap = 0;
|
||||
break;
|
||||
case 15:
|
||||
num = 640;
|
||||
bitmapGridY = 160;
|
||||
iconWidth = 640;
|
||||
num2 = 160;
|
||||
gap = 0;
|
||||
break;
|
||||
case 16:
|
||||
num = 410;
|
||||
bitmapGridY = 380;
|
||||
iconWidth = 410;
|
||||
num2 = 380;
|
||||
gap = 0;
|
||||
break;
|
||||
case 17:
|
||||
num = 226;
|
||||
bitmapGridY = 226;
|
||||
iconWidth = 226;
|
||||
num2 = 226;
|
||||
gap = 0;
|
||||
break;
|
||||
default:
|
||||
num = 0;
|
||||
bitmapGridY = 0;
|
||||
iconWidth = 0;
|
||||
num2 = 0;
|
||||
gap = 0;
|
||||
break;
|
||||
}
|
||||
if (num != 0)
|
||||
{
|
||||
Rectangle srcRectangle = GetSrcRectangle(bitmap, num, bitmapGridY, iconWidth, num2, gap, icon);
|
||||
Rectangle rectangle = GetDstRectangle(rect, iconWidth, num2, useHotSpot);
|
||||
float num3 = 0f;
|
||||
if (rotation != 0.0)
|
||||
{
|
||||
num3 = (float)Misc.DegToRad(rotation);
|
||||
rectangle = Misc.RotateAdjust(rectangle, num3);
|
||||
}
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
|
||||
spriteBatch.Draw(bitmap, rectangle, srcRectangle, Color.FromNonPremultiplied(255, 255, 255, (int)(255.0 * opacity)), num3, origin, effect, 0f);
|
||||
spriteBatch.End();
|
||||
}
|
||||
}
|
||||
|
||||
private Rectangle GetSrcRectangle(Texture2D bitmap, int bitmapGridX, int bitmapGridY, int iconWidth, int iconHeight, int gap, int icon)
|
||||
{
|
||||
int width = bitmap.Bounds.Width;
|
||||
int height = bitmap.Bounds.Height;
|
||||
int num = icon % (width / bitmapGridX);
|
||||
int num2 = icon / (width / bitmapGridX);
|
||||
bitmapGridX += gap;
|
||||
bitmapGridY += gap;
|
||||
return new Rectangle(gap + num * bitmapGridX, gap + num2 * bitmapGridY, iconWidth, iconHeight);
|
||||
}
|
||||
|
||||
private Rectangle GetDstRectangle(TinyRect rect, int iconWidth, int iconHeight, bool useHotSpot)
|
||||
{
|
||||
int num = ((rect.Width == 0) ? iconWidth : rect.Width);
|
||||
int num2 = ((rect.Height == 0) ? iconHeight : rect.Height);
|
||||
int num3 = (int)((double)rect.LeftX * zoom);
|
||||
int num4 = (int)((double)rect.TopY * zoom);
|
||||
int num5 = (int)((double)num3 + (double)num * zoom);
|
||||
int num6 = (int)((double)num4 + (double)num2 * zoom);
|
||||
if (useHotSpot && hotSpotZoom > 1.0)
|
||||
{
|
||||
num3 -= (int)hotSpotX;
|
||||
num4 -= (int)hotSpotY;
|
||||
num5 -= (int)hotSpotX;
|
||||
num6 -= (int)hotSpotY;
|
||||
num3 = (int)((double)num3 * hotSpotZoom);
|
||||
num4 = (int)((double)num4 * hotSpotZoom);
|
||||
num5 = (int)((double)num5 * hotSpotZoom);
|
||||
num6 = (int)((double)num6 * hotSpotZoom);
|
||||
num3 += (int)hotSpotX;
|
||||
num4 += (int)hotSpotY;
|
||||
num5 += (int)hotSpotX;
|
||||
num6 += (int)hotSpotY;
|
||||
}
|
||||
return new Rectangle(num3, num4, num5 - num3, num6 - num4);
|
||||
}
|
||||
|
||||
private Texture2D GetBitmap(int channel)
|
||||
{
|
||||
switch (channel)
|
||||
{
|
||||
case 2:
|
||||
return bitmapBlupi;
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return bitmapBlupi1;
|
||||
case 1:
|
||||
return bitmapObject;
|
||||
case 10:
|
||||
return bitmapElement;
|
||||
case 9:
|
||||
return bitmapExplo;
|
||||
case 6:
|
||||
return bitmapText;
|
||||
case 4:
|
||||
return bitmapButton;
|
||||
case 5:
|
||||
return bitmapJauge;
|
||||
case 14:
|
||||
return bitmapPad;
|
||||
case 15:
|
||||
return bitmapSpeedyBlupi;
|
||||
case 16:
|
||||
return bitmapBlupiYoupie;
|
||||
case 17:
|
||||
return bitmapGear;
|
||||
case 3:
|
||||
return bitmapBackground;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Resource
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//[DebuggerNonUserCode]
|
||||
//[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
//[CompilerGenerated]
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
internal class Resource
|
||||
{
|
||||
private static ResourceManager resourceMan;
|
||||
|
||||
private static CultureInfo resourceCulture;
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ReferenceEquals(resourceMan, null))
|
||||
{
|
||||
ResourceManager resourceManager = new ResourceManager("WindowsPhoneSpeedyBlupi.Resource", typeof(Resource).Assembly);
|
||||
resourceMan = resourceManager;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal static string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal Resource()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Slider
|
||||
using System;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Slider
|
||||
{
|
||||
public Slider(TinyPoint topLeftCorner, double value) {
|
||||
TopLeftCorner = topLeftCorner;
|
||||
value = Value;
|
||||
|
||||
}
|
||||
public TinyPoint TopLeftCorner { get; set; }
|
||||
|
||||
public double Value { get; set; }
|
||||
|
||||
private int PosLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return TopLeftCorner.X + 22;
|
||||
}
|
||||
}
|
||||
|
||||
private int PosRight
|
||||
{
|
||||
get
|
||||
{
|
||||
return TopLeftCorner.X + 248 - 22;
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Pixmap pixmap)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = TopLeftCorner.X - pixmap.Origin.X;
|
||||
tinyPoint.Y = TopLeftCorner.Y - pixmap.Origin.Y;
|
||||
TinyPoint dest = tinyPoint;
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = 0;
|
||||
tinyRect.RightX = 124;
|
||||
tinyRect.TopY = 0;
|
||||
tinyRect.BottomY = 22;
|
||||
TinyRect rect = tinyRect;
|
||||
pixmap.DrawPart(5, dest, rect, 2.0);
|
||||
int num = (int)((double)(PosRight - PosLeft) * Value);
|
||||
int num2 = TopLeftCorner.Y + 22;
|
||||
int num3 = 94;
|
||||
TinyRect tinyRect2 = default(TinyRect);
|
||||
tinyRect2.LeftX = PosLeft + num - num3 / 2;
|
||||
tinyRect2.RightX = PosLeft + num + num3 / 2;
|
||||
tinyRect2.TopY = num2 - num3 / 2;
|
||||
tinyRect2.BottomY = num2 + num3 / 2;
|
||||
rect = tinyRect2;
|
||||
pixmap.DrawIcon(14, 1, rect, 1.0, false);
|
||||
TinyRect tinyRect3 = default(TinyRect);
|
||||
tinyRect3.LeftX = TopLeftCorner.X - 65;
|
||||
tinyRect3.RightX = TopLeftCorner.X - 65 + 60;
|
||||
tinyRect3.TopY = TopLeftCorner.Y - 10;
|
||||
tinyRect3.BottomY = TopLeftCorner.Y - 10 + 60;
|
||||
rect = tinyRect3;
|
||||
pixmap.DrawIcon(10, 37, rect, 1.0, false);
|
||||
TinyRect tinyRect4 = default(TinyRect);
|
||||
tinyRect4.LeftX = TopLeftCorner.X + 248 + 5;
|
||||
tinyRect4.RightX = TopLeftCorner.X + 248 + 5 + 60;
|
||||
tinyRect4.TopY = TopLeftCorner.Y - 10;
|
||||
tinyRect4.BottomY = TopLeftCorner.Y - 10 + 60;
|
||||
rect = tinyRect4;
|
||||
pixmap.DrawIcon(10, 38, rect, 1.0, false);
|
||||
}
|
||||
|
||||
public bool Move(TinyPoint pos)
|
||||
{
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.LeftX = TopLeftCorner.X - 50;
|
||||
tinyRect.RightX = TopLeftCorner.X + 248 + 50;
|
||||
tinyRect.TopY = TopLeftCorner.Y - 50;
|
||||
tinyRect.BottomY = TopLeftCorner.Y + 44 + 50;
|
||||
TinyRect rect = tinyRect;
|
||||
if (Misc.IsInside(rect, pos))
|
||||
{
|
||||
double val = ((double)pos.X - (double)PosLeft) / (double)(PosRight - PosLeft);
|
||||
val = Math.Max(val, 0.0);
|
||||
val = Math.Min(val, 1.0);
|
||||
if (Value != val)
|
||||
{
|
||||
Value = val;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,260 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Sound
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Sound
|
||||
{
|
||||
private class Play
|
||||
{
|
||||
private readonly SoundEffectInstance sei;
|
||||
|
||||
private readonly int channel;
|
||||
|
||||
public int Channel
|
||||
{
|
||||
get
|
||||
{
|
||||
return channel;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsFree
|
||||
{
|
||||
get
|
||||
{
|
||||
return sei.State == SoundState.Stopped;
|
||||
}
|
||||
}
|
||||
|
||||
public Play(SoundEffect se, int channel, double volume, double balance, double? pitch, bool isLooped)
|
||||
{
|
||||
this.channel = channel;
|
||||
int num = channel * 2;
|
||||
if (num >= 0 && num < tableVolumePitch.Length)
|
||||
{
|
||||
volume *= tableVolumePitch[num];
|
||||
pitch = tableVolumePitch[num + 1];
|
||||
}
|
||||
sei = se.CreateInstance();
|
||||
sei.Volume = (float)volume;
|
||||
sei.Pan = (float)balance;
|
||||
sei.Pitch = (float)(pitch ?? 0.0);
|
||||
sei.IsLooped = isLooped;
|
||||
sei.Play();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
sei.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static double[] tableVolumePitch = new double[200]
|
||||
{
|
||||
1.0, 0.0, 0.5, 1.0, 0.5, 1.0, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.1, 1.0, 0.3, 1.0, 0.2, 1.0, 0.3, 1.0, 0.5,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.1, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 0.7, 0.2, 1.0, 0.1, 1.0, 0.1,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.4, 1.0, 0.0, 1.0, 0.0,
|
||||
1.0, 0.0, 1.0, 0.0, 1.0, 0.2, 1.0, 0.2, 0.7, 0.4,
|
||||
1.0, 0.2, 1.0, 0.4, 1.0, 0.2, 0.5, 1.0, 0.5, 1.0,
|
||||
1.0, 0.4, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 0.6, 0.4, 0.8, 0.1,
|
||||
0.6, 0.5, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.0,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.0,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.0, 1.0, 0.0, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 0.6, 0.4,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2,
|
||||
1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2, 1.0, 0.2
|
||||
};
|
||||
|
||||
public static readonly int MAXVOLUME = 20;
|
||||
|
||||
private readonly Game1 game1;
|
||||
|
||||
private readonly GameData gameData;
|
||||
|
||||
private readonly List<SoundEffect> soundEffects;
|
||||
|
||||
private readonly List<Play> plays;
|
||||
|
||||
private double volume;
|
||||
|
||||
public Sound(Game1 game1, GameData gameData)
|
||||
{
|
||||
this.game1 = game1;
|
||||
this.gameData = gameData;
|
||||
soundEffects = new List<SoundEffect>();
|
||||
plays = new List<Play>();
|
||||
volume = 1.0;
|
||||
SoundEffect.MasterVolume = 1f;
|
||||
}
|
||||
|
||||
public void LoadContent()
|
||||
{
|
||||
if (Def.HasSound)
|
||||
{
|
||||
for (int i = 0; i <= 92; i++)
|
||||
{
|
||||
string assetName = string.Format("sounds/sound{0}", i.ToString("d3"));
|
||||
SoundEffect item = game1.Content.Load<SoundEffect>(assetName);
|
||||
soundEffects.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Create()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetState(bool bState)
|
||||
{
|
||||
}
|
||||
|
||||
public void SetCDAudio(bool bAudio)
|
||||
{
|
||||
}
|
||||
|
||||
public bool GetEnable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetAudioVolume(int volume)
|
||||
{
|
||||
this.volume = (double)volume / (double)MAXVOLUME;
|
||||
}
|
||||
|
||||
public int GetAudioVolume()
|
||||
{
|
||||
return (int)(volume * (double)MAXVOLUME);
|
||||
}
|
||||
|
||||
public void SetMidiVolume(int volume)
|
||||
{
|
||||
}
|
||||
|
||||
public int GetMidiVolume()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void StopAll()
|
||||
{
|
||||
while (plays.Any())
|
||||
{
|
||||
plays[0].Stop();
|
||||
plays.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
public bool PlayImage(int channel, TinyPoint pos)
|
||||
{
|
||||
return PlayImage(channel, pos, -1, false);
|
||||
}
|
||||
|
||||
public bool PlayImage(int channel, TinyPoint pos, int rank, bool bLoop)
|
||||
{
|
||||
if (!gameData.Sounds)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (channel >= 0 && channel < soundEffects.Count)
|
||||
{
|
||||
if (channel != 10 && plays.Where((Play x) => x.Channel == channel && !x.IsFree).Any())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (plays.Count >= 10)
|
||||
{
|
||||
int num = 0;
|
||||
while (num < plays.Count)
|
||||
{
|
||||
if (plays[num].IsFree)
|
||||
{
|
||||
plays.RemoveAt(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Play item = new Play(soundEffects[channel], channel, (float)GetVolume(pos), (float)GetBalance(pos), null, bLoop);
|
||||
plays.Add(item);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool PosImage(int channel, TinyPoint pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Stop(int channel)
|
||||
{
|
||||
int num = 0;
|
||||
while (num < plays.Count)
|
||||
{
|
||||
if (plays[num].Channel == channel)
|
||||
{
|
||||
plays[num].Stop();
|
||||
plays.RemoveAt(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private double GetVolume(TinyPoint pos)
|
||||
{
|
||||
double val = 1.0;
|
||||
if (pos.X < 0)
|
||||
{
|
||||
val = 1.0 + (double)(pos.X / 640) * 2.0;
|
||||
}
|
||||
if (pos.X > 640)
|
||||
{
|
||||
pos.X -= 640;
|
||||
val = 1.0 - (double)(pos.X / 640) * 2.0;
|
||||
}
|
||||
val = Math.Max(val, 0.0);
|
||||
val = Math.Min(val, 1.0);
|
||||
double val2 = 1.0;
|
||||
if (pos.Y < 0)
|
||||
{
|
||||
val2 = 1.0 + (double)(pos.Y / 480) * 3.0;
|
||||
}
|
||||
if (pos.Y > 480)
|
||||
{
|
||||
pos.Y -= 480;
|
||||
val2 = 1.0 - (double)(pos.Y / 480) * 3.0;
|
||||
}
|
||||
val2 = Math.Max(val2, 0.0);
|
||||
val2 = Math.Min(val2, 1.0);
|
||||
return Math.Min(val, val2) * volume;
|
||||
}
|
||||
|
||||
private double GetBalance(TinyPoint pos)
|
||||
{
|
||||
double val = (double)pos.X * 2.0 / 640.0 - 1.0;
|
||||
val = Math.Max(val, -1.0);
|
||||
return Math.Min(val, 1.0);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,295 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Text
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public static class Text
|
||||
{
|
||||
private static short[] table_char = new short[1536]
|
||||
{
|
||||
0, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 2, 0, 0, -1, 0, 0, 3, 0,
|
||||
0, -1, 0, 0, 4, 0, 0, -1, 0, 0,
|
||||
5, 0, 0, -1, 0, 0, 6, 0, 0, -1,
|
||||
0, 0, 7, 0, 0, -1, 0, 0, 8, 0,
|
||||
0, -1, 0, 0, 9, 0, 0, -1, 0, 0,
|
||||
10, 0, 0, -1, 0, 0, 11, 0, 0, -1,
|
||||
0, 0, 12, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 14, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 32, 0, 0, -1, 0, 0, 33, 0,
|
||||
0, -1, 0, 0, 34, 0, 0, -1, 0, 0,
|
||||
35, 0, 0, -1, 0, 0, 36, 0, 0, -1,
|
||||
0, 0, 37, 0, 0, -1, 0, 0, 38, 0,
|
||||
0, -1, 0, 0, 39, 0, 0, -1, 0, 0,
|
||||
40, 0, 0, -1, 0, 0, 41, 0, 0, -1,
|
||||
0, 0, 42, 0, 0, -1, 0, 0, 43, 0,
|
||||
0, -1, 0, 0, 44, 0, 0, -1, 0, 0,
|
||||
45, 0, 0, -1, 0, 0, 46, 0, 0, -1,
|
||||
0, 0, 47, 0, 0, -1, 0, 0, 48, 0,
|
||||
0, -1, 0, 0, 49, 0, 0, -1, 0, 0,
|
||||
50, 0, 0, -1, 0, 0, 51, 0, 0, -1,
|
||||
0, 0, 52, 0, 0, -1, 0, 0, 53, 0,
|
||||
0, -1, 0, 0, 54, 0, 0, -1, 0, 0,
|
||||
55, 0, 0, -1, 0, 0, 56, 0, 0, -1,
|
||||
0, 0, 57, 0, 0, -1, 0, 0, 58, 0,
|
||||
0, -1, 0, 0, 59, 0, 0, -1, 0, 0,
|
||||
60, 0, 0, -1, 0, 0, 61, 0, 0, -1,
|
||||
0, 0, 62, 0, 0, -1, 0, 0, 63, 0,
|
||||
0, -1, 0, 0, 64, 0, 0, -1, 0, 0,
|
||||
65, 0, 0, -1, 0, 0, 66, 0, 0, -1,
|
||||
0, 0, 67, 0, 0, -1, 0, 0, 68, 0,
|
||||
0, -1, 0, 0, 69, 0, 0, -1, 0, 0,
|
||||
70, 0, 0, -1, 0, 0, 71, 0, 0, -1,
|
||||
0, 0, 72, 0, 0, -1, 0, 0, 73, 0,
|
||||
0, -1, 0, 0, 74, 0, 0, -1, 0, 0,
|
||||
75, 0, 0, -1, 0, 0, 76, 0, 0, -1,
|
||||
0, 0, 77, 0, 0, -1, 0, 0, 78, 0,
|
||||
0, -1, 0, 0, 79, 0, 0, -1, 0, 0,
|
||||
80, 0, 0, -1, 0, 0, 81, 0, 0, -1,
|
||||
0, 0, 82, 0, 0, -1, 0, 0, 83, 0,
|
||||
0, -1, 0, 0, 84, 0, 0, -1, 0, 0,
|
||||
85, 0, 0, -1, 0, 0, 86, 0, 0, -1,
|
||||
0, 0, 87, 0, 0, -1, 0, 0, 88, 0,
|
||||
0, -1, 0, 0, 89, 0, 0, -1, 0, 0,
|
||||
90, 0, 0, -1, 0, 0, 91, 0, 0, -1,
|
||||
0, 0, 92, 0, 0, -1, 0, 0, 93, 0,
|
||||
0, -1, 0, 0, 94, 0, 0, -1, 0, 0,
|
||||
95, 0, 0, -1, 0, 0, 96, 0, 0, -1,
|
||||
0, 0, 97, 0, 0, -1, 0, 0, 98, 0,
|
||||
0, -1, 0, 0, 99, 0, 0, -1, 0, 0,
|
||||
100, 0, 0, -1, 0, 0, 101, 0, 0, -1,
|
||||
0, 0, 102, 0, 0, -1, 0, 0, 103, 0,
|
||||
0, -1, 0, 0, 104, 0, 0, -1, 0, 0,
|
||||
105, 0, 0, -1, 0, 0, 106, 0, 0, -1,
|
||||
0, 0, 107, 0, 0, -1, 0, 0, 108, 0,
|
||||
0, -1, 0, 0, 109, 0, 0, -1, 0, 0,
|
||||
110, 0, 0, -1, 0, 0, 111, 0, 0, -1,
|
||||
0, 0, 112, 0, 0, -1, 0, 0, 113, 0,
|
||||
0, -1, 0, 0, 114, 0, 0, -1, 0, 0,
|
||||
115, 0, 0, -1, 0, 0, 116, 0, 0, -1,
|
||||
0, 0, 117, 0, 0, -1, 0, 0, 118, 0,
|
||||
0, -1, 0, 0, 119, 0, 0, -1, 0, 0,
|
||||
120, 0, 0, -1, 0, 0, 121, 0, 0, -1,
|
||||
0, 0, 122, 0, 0, -1, 0, 0, 123, 0,
|
||||
0, -1, 0, 0, 124, 0, 0, -1, 0, 0,
|
||||
125, 0, 0, -1, 0, 0, 126, 0, 0, -1,
|
||||
0, 0, 127, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 5, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 4, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 16, 0, 0, -1, 0, 0,
|
||||
97, 0, 0, 2, 2, 0, 17, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 27, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 29, 0, 0, -1,
|
||||
0, 0, 19, 0, 0, -1, 0, 0, 18, 0,
|
||||
0, -1, 0, 0, 21, 0, 0, -1, 0, 0,
|
||||
20, 0, 0, -1, 0, 0, 1, 0, 0, -1,
|
||||
0, 0, 105, 0, 0, 2, -1, 0, 23, 0,
|
||||
0, -1, 0, 0, 22, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 110, 0, 0, 126,
|
||||
-1, 0, 1, 0, 0, -1, 0, 0, 111, 0,
|
||||
0, 2, 1, 0, 24, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0, 28, 0, 0, -1,
|
||||
0, 0, 1, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 25, 0, 0, -1, 0, 0,
|
||||
117, 0, 0, 2, 2, 0, 26, 0, 0, -1,
|
||||
0, 0, 15, 0, 0, -1, 0, 0, 1, 0,
|
||||
0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
|
||||
1, 0, 0, -1, 0, 0
|
||||
};
|
||||
|
||||
private static short[] table_accents = new short[15]
|
||||
{
|
||||
252, 224, 226, 233, 232, 235, 234, 239, 238, 244,
|
||||
249, 251, 228, 246, 231
|
||||
};
|
||||
|
||||
private static short[] table_width = new short[128]
|
||||
{
|
||||
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 14, 13, 15, 15, 15, 15,
|
||||
15, 15, 11, 12, 14, 13, 13, 15, 15, 14,
|
||||
0, 0, 9, 5, 10, 25, 17, 22, 18, 5,
|
||||
9, 9, 14, 13, 6, 10, 6, 14, 18, 10,
|
||||
14, 14, 17, 16, 16, 17, 15, 16, 5, 6,
|
||||
9, 12, 10, 14, 25, 18, 16, 17, 18, 16,
|
||||
16, 19, 20, 15, 15, 15, 14, 24, 22, 22,
|
||||
15, 24, 16, 18, 15, 19, 18, 29, 20, 18,
|
||||
19, 8, 13, 8, 12, 20, 7, 15, 15, 13,
|
||||
15, 15, 13, 14, 14, 6, 8, 14, 6, 21,
|
||||
16, 14, 14, 13, 12, 14, 11, 13, 13, 19,
|
||||
16, 15, 14, 10, 5, 11, 16, 0
|
||||
};
|
||||
|
||||
public static void DrawTextLeft(Pixmap pixmap, TinyPoint pos, string text, double size)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
DrawText(pixmap, pos, text, size);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawText(Pixmap pixmap, TinyPoint pos, string text, double size)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
foreach (char car in text)
|
||||
{
|
||||
DrawChar(pixmap, ref pos, car, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawTextPente(Pixmap pixmap, TinyPoint pos, string text, int pente, double size)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
int y = pos.Y;
|
||||
int num = 0;
|
||||
foreach (char c in text)
|
||||
{
|
||||
int charWidth = GetCharWidth(c, size);
|
||||
DrawChar(pixmap, ref pos, c, size);
|
||||
num += charWidth;
|
||||
pos.Y = y + num / pente;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawTextCenter(Pixmap pixmap, TinyPoint pos, string text, double size)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
TinyPoint pos2 = default(TinyPoint);
|
||||
pos2.X = pos.X - GetTextWidth(text, size) / 2;
|
||||
pos2.Y = pos.Y;
|
||||
DrawText(pixmap, pos2, text, size);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetTextWidth(string text, double size)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
foreach (char c in text)
|
||||
{
|
||||
num += GetCharWidth(c, size);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private static int GetOffset(char c)
|
||||
{
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
if ((short)c == table_accents[i])
|
||||
{
|
||||
return 15 + i;
|
||||
}
|
||||
}
|
||||
if (c < '\0' || c > '\u0080')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private static void DrawChar(Pixmap pixmap, ref TinyPoint pos, char car, double size)
|
||||
{
|
||||
TinyPoint pos2 = default(TinyPoint);
|
||||
int num = (short)car * 6;
|
||||
int rank = table_char[num];
|
||||
pos2.X = pos.X + table_char[num + 1];
|
||||
pos2.Y = pos.Y + table_char[num + 2];
|
||||
DrawCharSingle(pixmap, pos2, rank, size);
|
||||
rank = table_char[num + 3];
|
||||
if (rank != -1)
|
||||
{
|
||||
pos2.X = pos.X + table_char[num + 4];
|
||||
pos2.Y = pos.Y + table_char[num + 5];
|
||||
DrawCharSingle(pixmap, pos2, rank, size);
|
||||
}
|
||||
pos.X += GetCharWidth(car, size);
|
||||
}
|
||||
|
||||
private static int GetCharWidth(char c, double size)
|
||||
{
|
||||
return (int)((double)(table_width[table_char[(short)c * 6]] + 1) * size);
|
||||
}
|
||||
|
||||
private static void DrawCharSingle(Pixmap pixmap, TinyPoint pos, int rank, double size)
|
||||
{
|
||||
pixmap.DrawChar(rank, pos, size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.TinyPoint
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public struct TinyPoint
|
||||
{
|
||||
public int X;
|
||||
|
||||
public int Y;
|
||||
|
||||
public TinyPoint(int x, int y)
|
||||
{
|
||||
X = x; Y = y;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0};{1}", X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.TinyRect
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public struct TinyRect
|
||||
{
|
||||
public int LeftX;
|
||||
|
||||
public int RightX;
|
||||
|
||||
public int TopY;
|
||||
|
||||
public int BottomY;
|
||||
|
||||
public TinyRect(int leftX, int rightX, int topY, int bottomY)
|
||||
{
|
||||
LeftX = leftX;
|
||||
RightX = rightX;
|
||||
TopY = topY;
|
||||
BottomY = bottomY;
|
||||
}
|
||||
|
||||
public int Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return RightX - LeftX;
|
||||
}
|
||||
}
|
||||
|
||||
public int Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return BottomY - TopY;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0};{1};{2};{3}", LeftX, TopY, RightX, BottomY);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,465 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Worlds
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public static class Worlds
|
||||
{
|
||||
private static StringBuilder output = new StringBuilder();
|
||||
|
||||
private static string GameDataFilename
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SpeedyBlupi";
|
||||
}
|
||||
}
|
||||
|
||||
private static string CurrentGameFilename
|
||||
{
|
||||
get
|
||||
{
|
||||
return "CurrentGame";
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] ReadWorld(int gamer, int rank)
|
||||
{
|
||||
string worldFilename = GetWorldFilename(gamer, rank);
|
||||
string text = null;
|
||||
try
|
||||
{
|
||||
Stream stream = TitleContainer.OpenStream(worldFilename);
|
||||
StreamReader streamReader = new StreamReader(stream);
|
||||
text = streamReader.ReadToEnd();
|
||||
stream.Close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Write(e.Message);
|
||||
Debug.Write("Fatal error. Loading world failed: " + worldFilename + "\n");
|
||||
//Environment.Exit(1);
|
||||
}
|
||||
if (text == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return text.Split("\n");
|
||||
}
|
||||
|
||||
private static string GetWorldFilename(int gamer, int rank)
|
||||
{
|
||||
return string.Format("worlds/world{0}.txt", rank.ToString("d3"));
|
||||
}
|
||||
|
||||
public static bool ReadGameData(byte[] data)
|
||||
{
|
||||
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
|
||||
if (userStoreForApplication.FileExists(GameDataFilename))
|
||||
{
|
||||
IsolatedStorageFileStream isolatedStorageFileStream = null;
|
||||
try
|
||||
{
|
||||
isolatedStorageFileStream = userStoreForApplication.OpenFile(GameDataFilename, FileMode.Open);
|
||||
}
|
||||
catch (IsolatedStorageException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (isolatedStorageFileStream != null)
|
||||
{
|
||||
int count = Math.Min(data.Length, (int)isolatedStorageFileStream.Length);
|
||||
isolatedStorageFileStream.Read(data, 0, count);
|
||||
isolatedStorageFileStream.Close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void WriteGameData(byte[] data)
|
||||
{
|
||||
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
|
||||
IsolatedStorageFileStream isolatedStorageFileStream = userStoreForApplication.OpenFile(GameDataFilename, FileMode.Create);
|
||||
if (isolatedStorageFileStream != null)
|
||||
{
|
||||
isolatedStorageFileStream.Write(data, 0, data.Length);
|
||||
isolatedStorageFileStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteCurrentGame()
|
||||
{
|
||||
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
|
||||
try
|
||||
{
|
||||
userStoreForApplication.DeleteFile(CurrentGameFilename);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static string ReadCurrentGame()
|
||||
{
|
||||
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
|
||||
if (userStoreForApplication.FileExists(CurrentGameFilename))
|
||||
{
|
||||
IsolatedStorageFileStream isolatedStorageFileStream = null;
|
||||
try
|
||||
{
|
||||
isolatedStorageFileStream = userStoreForApplication.OpenFile(CurrentGameFilename, FileMode.Open);
|
||||
}
|
||||
catch (IsolatedStorageException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (isolatedStorageFileStream != null)
|
||||
{
|
||||
byte[] array = new byte[isolatedStorageFileStream.Length];
|
||||
isolatedStorageFileStream.Read(array, 0, array.Length);
|
||||
isolatedStorageFileStream.Close();
|
||||
return Encoding.UTF8.GetString(array, 0, array.Length);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void WriteCurrentGame(string data)
|
||||
{
|
||||
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
|
||||
IsolatedStorageFileStream isolatedStorageFileStream = userStoreForApplication.OpenFile(CurrentGameFilename, FileMode.Create);
|
||||
if (isolatedStorageFileStream != null)
|
||||
{
|
||||
isolatedStorageFileStream.Write(Encoding.UTF8.GetBytes(data), 0, data.Length);
|
||||
isolatedStorageFileStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetIntArrayField(string[] lines, string section, int rank, string name, int[] array)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (!text.StartsWith(section + ":") || rank-- != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num = text.IndexOf(name + "=");
|
||||
if (num == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(" ", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
string[] array2 = text.Substring(num, num2 - num).Split(',');
|
||||
for (int j = 0; j < array2.Length; j++)
|
||||
{
|
||||
int result;
|
||||
if (int.TryParse(array2[j], out result))
|
||||
{
|
||||
array[j] = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
array[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetBoolField(string[] lines, string section, int rank, string name)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (text.StartsWith(section + ":") && rank-- == 0)
|
||||
{
|
||||
int num = text.IndexOf(name + "=");
|
||||
if (num == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(" ", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
string value = text.Substring(num, num2 - num);
|
||||
bool result;
|
||||
if (bool.TryParse(value, out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetIntField(string[] lines, string section, int rank, string name)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (text.StartsWith(section + ":") && rank-- == 0)
|
||||
{
|
||||
int num = text.IndexOf(name + "=");
|
||||
if (num == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(" ", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
string s = text.Substring(num, num2 - num);
|
||||
int result;
|
||||
if (int.TryParse(s, out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static double GetDoubleField(string[] lines, string section, int rank, string name)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (text.StartsWith(section + ":") && rank-- == 0)
|
||||
{
|
||||
int num = text.IndexOf(name + "=");
|
||||
if (num == -1)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(" ", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
string s = text.Substring(num, num2 - num);
|
||||
double result;
|
||||
if (double.TryParse(s, out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public static TinyPoint GetPointField(string[] lines, string section, int rank, string name)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (text.StartsWith(section + ":") && rank-- == 0)
|
||||
{
|
||||
int num = text.IndexOf(name + "=");
|
||||
if (num == -1)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(";", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
int num3 = text.IndexOf(" ", num);
|
||||
if (num3 == -1)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
string s = text.Substring(num, num2 - num);
|
||||
string s2 = text.Substring(num2 + 1, num3 - num2 - 1);
|
||||
int result;
|
||||
if (!int.TryParse(s, out result))
|
||||
{
|
||||
return default;
|
||||
}
|
||||
int result2;
|
||||
if (!int.TryParse(s2, out result2))
|
||||
{
|
||||
return default;
|
||||
}
|
||||
TinyPoint result3 = default;
|
||||
result3.X = result;
|
||||
result3.Y = result2;
|
||||
return result3;
|
||||
}
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public static int? GetDecorField(string[] lines, string section, int x, int y)
|
||||
{
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
string text = lines[i];
|
||||
if (text.StartsWith(section + ":"))
|
||||
{
|
||||
text = lines[i + 1 + x];
|
||||
string[] array = text.Split(',');
|
||||
if (string.IsNullOrEmpty(array[y]))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int result;
|
||||
if (int.TryParse(array[y], out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void GetDoorsField(string[] lines, string section, int[] doors)
|
||||
{
|
||||
foreach (string text in lines)
|
||||
{
|
||||
if (!text.StartsWith(section + ":"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string[] array = text.Substring(section.Length + 2).Split(',');
|
||||
for (int j = 0; j < array.Length; j++)
|
||||
{
|
||||
int result;
|
||||
if (string.IsNullOrEmpty(array[j]))
|
||||
{
|
||||
doors[j] = 1;
|
||||
}
|
||||
else if (int.TryParse(array[j], out result))
|
||||
{
|
||||
doors[j] = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteClear()
|
||||
{
|
||||
output.Clear();
|
||||
}
|
||||
|
||||
public static void WriteSection(string section)
|
||||
{
|
||||
output.Append(section);
|
||||
output.Append(": ");
|
||||
}
|
||||
|
||||
public static void WriteIntArrayField(string name, int[] array)
|
||||
{
|
||||
output.Append(name);
|
||||
output.Append("=");
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
if (array[i] != 0)
|
||||
{
|
||||
output.Append(array[i].ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
if (i < array.Length - 1)
|
||||
{
|
||||
output.Append(",");
|
||||
}
|
||||
}
|
||||
output.Append(" ");
|
||||
}
|
||||
|
||||
public static void WriteBoolField(string name, bool n)
|
||||
{
|
||||
output.Append(name);
|
||||
output.Append("=");
|
||||
output.Append(n.ToString(CultureInfo.InvariantCulture));
|
||||
output.Append(" ");
|
||||
}
|
||||
|
||||
public static void WriteIntField(string name, int n)
|
||||
{
|
||||
output.Append(name);
|
||||
output.Append("=");
|
||||
output.Append(n.ToString(CultureInfo.InvariantCulture));
|
||||
output.Append(" ");
|
||||
}
|
||||
|
||||
public static void WriteDoubleField(string name, double n)
|
||||
{
|
||||
output.Append(name);
|
||||
output.Append("=");
|
||||
output.Append(n.ToString(CultureInfo.InvariantCulture));
|
||||
output.Append(" ");
|
||||
}
|
||||
|
||||
public static void WritePointField(string name, TinyPoint p)
|
||||
{
|
||||
output.Append(name);
|
||||
output.Append("=");
|
||||
output.Append(p.X.ToString(CultureInfo.InvariantCulture));
|
||||
output.Append(";");
|
||||
output.Append(p.Y.ToString(CultureInfo.InvariantCulture));
|
||||
output.Append(" ");
|
||||
}
|
||||
|
||||
public static void WriteDecorField(int[] line)
|
||||
{
|
||||
for (int i = 0; i < line.Length; i++)
|
||||
{
|
||||
if (line[i] != -1)
|
||||
{
|
||||
output.Append(line[i].ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
if (i < line.Length - 1)
|
||||
{
|
||||
output.Append(",");
|
||||
}
|
||||
}
|
||||
output.Append("\n");
|
||||
}
|
||||
|
||||
public static void WriteDoorsField(int[] doors)
|
||||
{
|
||||
for (int i = 0; i < doors.Length; i++)
|
||||
{
|
||||
if (doors[i] != 1)
|
||||
{
|
||||
output.Append(doors[i].ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
if (i < doors.Length - 1)
|
||||
{
|
||||
output.Append(",");
|
||||
}
|
||||
}
|
||||
output.Append("\n");
|
||||
}
|
||||
|
||||
public static void WriteEndSection()
|
||||
{
|
||||
output.Append("\n");
|
||||
}
|
||||
|
||||
public static string GetWriteString()
|
||||
{
|
||||
return output.ToString();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Def
|
||||
|
||||
using static WindowsPhoneSpeedyBlupi.Xna;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
|
||||
public static class Xna
|
||||
{
|
||||
public enum Platform
|
||||
{
|
||||
Desktop,
|
||||
Android,
|
||||
iOS,
|
||||
Web
|
||||
}
|
||||
|
||||
public enum XnaImpl
|
||||
{
|
||||
MonoGame = ProgrammingLanguage.CSharp,
|
||||
Fna = ProgrammingLanguage.CSharp,
|
||||
Kni = ProgrammingLanguage.CSharp,
|
||||
JXNA = ProgrammingLanguage.Java,
|
||||
JSXN = ProgrammingLanguage.JavaScript
|
||||
}
|
||||
|
||||
public enum ProgrammingLanguage
|
||||
{
|
||||
CSharp,
|
||||
Java,
|
||||
JavaScript
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static ProgrammingLanguage getProgrammingLanguage(this XnaImpl xnaImpl)
|
||||
{
|
||||
return (ProgrammingLanguage)((int)xnaImpl);
|
||||
}
|
||||
public static bool isDesktop(this Platform platform)
|
||||
{
|
||||
return platform == Platform.Desktop;
|
||||
}
|
||||
public static bool isAndroid(this Platform platform)
|
||||
{
|
||||
return platform == Platform.Android;
|
||||
}
|
||||
public static bool isIOS(this Platform platform)
|
||||
{
|
||||
return platform == Platform.iOS;
|
||||
}
|
||||
public static bool isWeb(this Platform platform)
|
||||
{
|
||||
return platform == Platform.Web;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user