Added Speedy Blupi for Windows Phone C# classes - 17th commit of the repository mobile-eggbert
This commit is contained in:
parent
ccd4a734e2
commit
e62b8fbb63
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public interface Accelerometer
|
||||
{
|
||||
void Start();
|
||||
void Stop();
|
||||
event EventHandler<AccelerometerEventArgs> CurrentValueChanged;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class AccelerometerDummyImpl : Accelerometer
|
||||
{
|
||||
public event EventHandler<AccelerometerEventArgs> CurrentValueChanged;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
//throw new AccelerometerFailedException();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
//throw new AccelerometerFailedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class AccelerometerEventArgs : EventArgs
|
||||
{
|
||||
|
||||
public float X { get; }
|
||||
public float Y { get; }
|
||||
public float Z { get; }
|
||||
|
||||
public AccelerometerEventArgs(float x, float y, float z)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class AccelerometerFactory
|
||||
{
|
||||
public static Accelerometer Create() { return new AccelerometerDummyImpl(); }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class AccelerometerFailedException : Exception
|
||||
{
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,705 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// 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 ButtonGlygh
|
||||
{
|
||||
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 enum KeyboardPress
|
||||
{
|
||||
None, Up, Right, Down, Left, LeftControl, Space, Escape, Pause
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,983 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Game1
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
//using Microsoft.Xna.Framework.GamerServices;//todo remove me
|
||||
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.ButtonGlygh[] cheatGeste = new Def.ButtonGlygh[10]
|
||||
{
|
||||
Def.ButtonGlygh.Cheat12,
|
||||
Def.ButtonGlygh.Cheat22,
|
||||
Def.ButtonGlygh.Cheat32,
|
||||
Def.ButtonGlygh.Cheat12,
|
||||
Def.ButtonGlygh.Cheat11,
|
||||
Def.ButtonGlygh.Cheat21,
|
||||
Def.ButtonGlygh.Cheat22,
|
||||
Def.ButtonGlygh.Cheat21,
|
||||
Def.ButtonGlygh.Cheat31,
|
||||
Def.ButtonGlygh.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()
|
||||
{
|
||||
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.ButtonGlygh buttonPressed = inputPad.ButtonPressed;
|
||||
if (buttonPressed >= Def.ButtonGlygh.InitGamerA && buttonPressed <= Def.ButtonGlygh.InitGamerC)
|
||||
{
|
||||
SetGamer((int)(buttonPressed - 1));
|
||||
return;
|
||||
}
|
||||
switch (buttonPressed)
|
||||
{
|
||||
case Def.ButtonGlygh.InitSetup:
|
||||
SetPhase(Def.Phase.MainSetup);
|
||||
return;
|
||||
case Def.ButtonGlygh.PauseSetup:
|
||||
SetPhase(Def.Phase.PlaySetup);
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupSounds:
|
||||
gameData.Sounds = !gameData.Sounds;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupJump:
|
||||
gameData.JumpRight = !gameData.JumpRight;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupZoom:
|
||||
gameData.AutoZoom = !gameData.AutoZoom;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupAccel:
|
||||
gameData.AccelActive = !gameData.AccelActive;
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupReset:
|
||||
gameData.Reset();
|
||||
gameData.Write();
|
||||
return;
|
||||
case Def.ButtonGlygh.SetupReturn:
|
||||
if (playSetup)
|
||||
{
|
||||
SetPhase(Def.Phase.Play, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPhase(Def.Phase.Init);
|
||||
}
|
||||
return;
|
||||
case Def.ButtonGlygh.InitPlay:
|
||||
SetPhase(Def.Phase.Play, 1);
|
||||
return;
|
||||
case Def.ButtonGlygh.PlayPause:
|
||||
SetPhase(Def.Phase.Pause);
|
||||
return;
|
||||
case Def.ButtonGlygh.WinLostReturn:
|
||||
case Def.ButtonGlygh.PauseMenu:
|
||||
case Def.ButtonGlygh.ResumeMenu:
|
||||
SetPhase(Def.Phase.Init);
|
||||
break;
|
||||
}
|
||||
switch (buttonPressed)
|
||||
{
|
||||
case Def.ButtonGlygh.ResumeContinue:
|
||||
ContinueMission();
|
||||
return;
|
||||
case Def.ButtonGlygh.InitBuy:
|
||||
case Def.ButtonGlygh.TrialBuy:
|
||||
MarketPlace.Show(PlayerIndex.One);
|
||||
SetPhase(Def.Phase.Init);
|
||||
return;
|
||||
case Def.ButtonGlygh.InitRanking:
|
||||
SetPhase(Def.Phase.Ranking);
|
||||
return;
|
||||
case Def.ButtonGlygh.TrialCancel:
|
||||
case Def.ButtonGlygh.RankingContinue:
|
||||
SetPhase(Def.Phase.Init);
|
||||
return;
|
||||
case Def.ButtonGlygh.PauseBack:
|
||||
MissionBack();
|
||||
return;
|
||||
case Def.ButtonGlygh.PauseRestart:
|
||||
SetPhase(Def.Phase.Play, mission);
|
||||
return;
|
||||
case Def.ButtonGlygh.PauseContinue:
|
||||
SetPhase(Def.Phase.Play, -1);
|
||||
return;
|
||||
case Def.ButtonGlygh.Cheat11:
|
||||
case Def.ButtonGlygh.Cheat12:
|
||||
case Def.ButtonGlygh.Cheat21:
|
||||
case Def.ButtonGlygh.Cheat22:
|
||||
case Def.ButtonGlygh.Cheat31:
|
||||
case Def.ButtonGlygh.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.ButtonGlygh.Cheat1 && buttonPressed <= Def.ButtonGlygh.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.ButtonGlygh glyph)
|
||||
{
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlygh.Cheat1:
|
||||
decor.CheatAction(Tables.CheatCodes.OpenDoors);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat2:
|
||||
decor.CheatAction(Tables.CheatCodes.SuperBlupi);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat3:
|
||||
decor.CheatAction(Tables.CheatCodes.ShowSecret);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat4:
|
||||
decor.CheatAction(Tables.CheatCodes.LayEgg);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat5:
|
||||
gameData.Reset();
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat6:
|
||||
simulateTrialMode = !simulateTrialMode;
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat7:
|
||||
decor.CheatAction(Tables.CheatCodes.CleanAll);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat8:
|
||||
decor.CheatAction(Tables.CheatCodes.AllTreasure);
|
||||
break;
|
||||
case Def.ButtonGlygh.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.Left = (int)(720.0 - 640.0 * num);
|
||||
tinyRect.Right = (int)(1360.0 - 640.0 * num);
|
||||
tinyRect.Top = 0;
|
||||
tinyRect.Bottom = 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.Left = 80;
|
||||
tinyRect2.Right = 720;
|
||||
tinyRect2.Top = (int)(-160.0 + num * 160.0);
|
||||
tinyRect2.Bottom = (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.Left = (int)(468.0 - 205.0 * num);
|
||||
tinyRect3.Right = (int)(468.0 + 205.0 * num);
|
||||
tinyRect3.Top = (int)(280.0 - 190.0 * num);
|
||||
tinyRect3.Bottom = (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.Left = (int)(418.0 - 205.0 * num);
|
||||
tinyRect4.Right = (int)(418.0 + 205.0 * num);
|
||||
tinyRect4.Top = (int)(190.0 - 190.0 * num);
|
||||
tinyRect4.Bottom = (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.Left = (int)(213.0 + 800.0 * num);
|
||||
tinyRect5.Right = (int)(623.0 + 800.0 * num);
|
||||
tinyRect5.Top = 0;
|
||||
tinyRect5.Bottom = 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.Left = (int)(418.0 - 205.0 * num);
|
||||
tinyRect6.Right = (int)(418.0 + 205.0 * num);
|
||||
tinyRect6.Top = (int)(190.0 - 190.0 * num);
|
||||
tinyRect6.Bottom = (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.Left = (int)(720.0 - 640.0 * num);
|
||||
tinyRect7.Right = (int)(1360.0 - 640.0 * num);
|
||||
tinyRect7.Top = 0;
|
||||
tinyRect7.Bottom = 160;
|
||||
TinyRect rect = tinyRect7;
|
||||
pixmap.DrawIcon(15, 0, rect, num * num, false);
|
||||
TinyRect tinyRect8 = default(TinyRect);
|
||||
tinyRect8.Left = 487;
|
||||
tinyRect8.Right = 713;
|
||||
tinyRect8.Top = 148;
|
||||
tinyRect8.Bottom = 374;
|
||||
TinyRect rect2 = tinyRect8;
|
||||
TinyRect tinyRect9 = default(TinyRect);
|
||||
tinyRect9.Left = 118;
|
||||
tinyRect9.Right = 570;
|
||||
tinyRect9.Top = 268;
|
||||
tinyRect9.Bottom = 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.Left = (int)(418.0 - 205.0 * num);
|
||||
tinyRect10.Right = (int)(418.0 + 205.0 * num);
|
||||
tinyRect10.Top = (int)(238.0 - 190.0 * num);
|
||||
tinyRect10.Bottom = (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.Left = (int)(418.0 - 205.0 * num);
|
||||
tinyRect11.Right = (int)(418.0 + 205.0 * num);
|
||||
tinyRect11.Top = (int)(238.0 - 190.0 * num);
|
||||
tinyRect11.Bottom = (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.Left = 10;
|
||||
tinyRect.Right = 260;
|
||||
tinyRect.Top = height - 325;
|
||||
tinyRect.Bottom = height - 10;
|
||||
TinyRect rect = tinyRect;
|
||||
pixmap.DrawIcon(14, 15, rect, 0.3, false);
|
||||
TinyRect tinyRect2 = default(TinyRect);
|
||||
tinyRect2.Left = width - 170;
|
||||
tinyRect2.Right = width - 10;
|
||||
tinyRect2.Top = height - ((IsTrialMode || IsRankingMode) ? 325 : 195);
|
||||
tinyRect2.Bottom = height - 10;
|
||||
rect = tinyRect2;
|
||||
pixmap.DrawIcon(14, 15, rect, 0.3, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonsText()
|
||||
{
|
||||
if (phase == Def.Phase.Init)
|
||||
{
|
||||
DrawButtonGamerText(Def.ButtonGlygh.InitGamerA, 0);
|
||||
DrawButtonGamerText(Def.ButtonGlygh.InitGamerB, 1);
|
||||
DrawButtonGamerText(Def.ButtonGlygh.InitGamerC, 2);
|
||||
DrawTextUnderButton(Def.ButtonGlygh.InitPlay, MyResource.TX_BUTTON_PLAY);
|
||||
DrawTextRightButton(Def.ButtonGlygh.InitSetup, MyResource.TX_BUTTON_SETUP);
|
||||
if (IsTrialMode)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.InitBuy, MyResource.TX_BUTTON_BUY);
|
||||
}
|
||||
if (IsRankingMode)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.InitRanking, MyResource.TX_BUTTON_RANKING);
|
||||
}
|
||||
}
|
||||
if (phase == Def.Phase.Pause)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.PauseMenu, MyResource.TX_BUTTON_MENU);
|
||||
if (mission != 1)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.PauseBack, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
DrawTextUnderButton(Def.ButtonGlygh.PauseSetup, MyResource.TX_BUTTON_SETUP);
|
||||
if (mission != 1 && mission % 10 != 0)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.PauseRestart, MyResource.TX_BUTTON_RESTART);
|
||||
}
|
||||
DrawTextUnderButton(Def.ButtonGlygh.PauseContinue, MyResource.TX_BUTTON_CONTINUE);
|
||||
}
|
||||
if (phase == Def.Phase.Resume)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.ResumeMenu, MyResource.TX_BUTTON_MENU);
|
||||
DrawTextUnderButton(Def.ButtonGlygh.ResumeContinue, MyResource.TX_BUTTON_CONTINUE);
|
||||
}
|
||||
if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup)
|
||||
{
|
||||
DrawTextRightButton(Def.ButtonGlygh.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS);
|
||||
DrawTextRightButton(Def.ButtonGlygh.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP);
|
||||
DrawTextRightButton(Def.ButtonGlygh.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM);
|
||||
DrawTextRightButton(Def.ButtonGlygh.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.ButtonGlygh.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.ButtonGlygh.TrialBuy, MyResource.TX_BUTTON_BUY);
|
||||
DrawTextUnderButton(Def.ButtonGlygh.TrialCancel, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
if (phase == Def.Phase.Ranking)
|
||||
{
|
||||
DrawTextUnderButton(Def.ButtonGlygh.RankingContinue, MyResource.TX_BUTTON_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonGamerText(Def.ButtonGlygh 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.Right + 5 - pixmap.Origin.X;
|
||||
tinyPoint.Y = buttonRect.Top + 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.Right + 5 - pixmap.Origin.X;
|
||||
tinyPoint2.Y = buttonRect.Top + 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.Right + 5 - pixmap.Origin.X;
|
||||
tinyPoint3.Y = buttonRect.Top + 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.Right + 5 - pixmap.Origin.X;
|
||||
tinyPoint4.Y = buttonRect.Top + 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.ButtonGlygh glyph, int res)
|
||||
{
|
||||
DrawTextRightButton(glyph, MyResource.LoadString(res));
|
||||
}
|
||||
|
||||
private void DrawTextRightButton(Def.ButtonGlygh glyph, string text)
|
||||
{
|
||||
TinyRect buttonRect = inputPad.GetButtonRect(glyph);
|
||||
string[] array = text.Split('\n');
|
||||
if (array.Length == 2)
|
||||
{
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = buttonRect.Right + 10 - pixmap.Origin.X;
|
||||
tinyPoint.Y = (buttonRect.Top + buttonRect.Bottom) / 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.Right + 10 - pixmap.Origin.X;
|
||||
tinyPoint2.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 8 - pixmap.Origin.Y;
|
||||
TinyPoint pos2 = tinyPoint2;
|
||||
Text.DrawText(pixmap, pos2, text, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawTextUnderButton(Def.ButtonGlygh glyph, int res)
|
||||
{
|
||||
TinyRect buttonRect = inputPad.GetButtonRect(glyph);
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = (buttonRect.Left + buttonRect.Right) / 2 - pixmap.Origin.X;
|
||||
tinyPoint.Y = buttonRect.Bottom + 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 = TrialMode.IsTrialModeEnabled();
|
||||
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 SetFullScreen(bool isFullScreen)
|
||||
//{
|
||||
// this.graphics.IsFullScreen = isFullScreen;
|
||||
// graphics.ToggleFullScreen();
|
||||
//}
|
||||
public void ToggleFullScreen()
|
||||
{
|
||||
this.graphics.ToggleFullScreen();
|
||||
}
|
||||
public bool IsFullScreen() { return this.graphics.IsFullScreen; }
|
||||
}
|
||||
}
|
@ -0,0 +1,220 @@
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,990 @@
|
||||
// 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.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Input.Touch;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
using static WindowsPhoneSpeedyBlupi.Def;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class InputPad
|
||||
{
|
||||
private static readonly int padSize = 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.ButtonGlygh> pressedGlyphs;
|
||||
|
||||
private readonly Accelerometer accelSensor;
|
||||
|
||||
private readonly Slider accelSlider;
|
||||
|
||||
private bool padPressed;
|
||||
|
||||
private bool showCheatMenu;
|
||||
|
||||
private TinyPoint padTouchPos;
|
||||
|
||||
private Def.ButtonGlygh lastButtonDown;
|
||||
|
||||
private Def.ButtonGlygh 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.ButtonGlygh ButtonPressed
|
||||
{
|
||||
get
|
||||
{
|
||||
Def.ButtonGlygh result = buttonPressed;
|
||||
buttonPressed = Def.ButtonGlygh.None;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowCheatMenu
|
||||
{
|
||||
get
|
||||
{
|
||||
return showCheatMenu;
|
||||
}
|
||||
set
|
||||
{
|
||||
showCheatMenu = value;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<Def.ButtonGlygh> ButtonGlyphs
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case Def.Phase.Init:
|
||||
yield return Def.ButtonGlygh.InitGamerA;
|
||||
yield return Def.ButtonGlygh.InitGamerB;
|
||||
yield return Def.ButtonGlygh.InitGamerC;
|
||||
yield return Def.ButtonGlygh.InitSetup;
|
||||
yield return Def.ButtonGlygh.InitPlay;
|
||||
if (game1.IsTrialMode)
|
||||
{
|
||||
yield return Def.ButtonGlygh.InitBuy;
|
||||
}
|
||||
if (game1.IsRankingMode)
|
||||
{
|
||||
yield return Def.ButtonGlygh.InitRanking;
|
||||
}
|
||||
break;
|
||||
case Def.Phase.Play:
|
||||
yield return Def.ButtonGlygh.PlayPause;
|
||||
yield return Def.ButtonGlygh.PlayAction;
|
||||
yield return Def.ButtonGlygh.PlayJump;
|
||||
if (accelStarted)
|
||||
{
|
||||
yield return Def.ButtonGlygh.PlayDown;
|
||||
}
|
||||
yield return Def.ButtonGlygh.Cheat11;
|
||||
yield return Def.ButtonGlygh.Cheat12;
|
||||
yield return Def.ButtonGlygh.Cheat21;
|
||||
yield return Def.ButtonGlygh.Cheat22;
|
||||
yield return Def.ButtonGlygh.Cheat31;
|
||||
yield return Def.ButtonGlygh.Cheat32;
|
||||
break;
|
||||
case Def.Phase.Pause:
|
||||
yield return Def.ButtonGlygh.PauseMenu;
|
||||
if (mission != 1)
|
||||
{
|
||||
yield return Def.ButtonGlygh.PauseBack;
|
||||
}
|
||||
yield return Def.ButtonGlygh.PauseSetup;
|
||||
if (mission != 1 && mission % 10 != 0)
|
||||
{
|
||||
yield return Def.ButtonGlygh.PauseRestart;
|
||||
}
|
||||
yield return Def.ButtonGlygh.PauseContinue;
|
||||
break;
|
||||
case Def.Phase.Resume:
|
||||
yield return Def.ButtonGlygh.ResumeMenu;
|
||||
yield return Def.ButtonGlygh.ResumeContinue;
|
||||
break;
|
||||
case Def.Phase.Lost:
|
||||
case Def.Phase.Win:
|
||||
yield return Def.ButtonGlygh.WinLostReturn;
|
||||
break;
|
||||
case Def.Phase.Trial:
|
||||
yield return Def.ButtonGlygh.TrialBuy;
|
||||
yield return Def.ButtonGlygh.TrialCancel;
|
||||
break;
|
||||
case Def.Phase.MainSetup:
|
||||
yield return Def.ButtonGlygh.SetupSounds;
|
||||
yield return Def.ButtonGlygh.SetupJump;
|
||||
yield return Def.ButtonGlygh.SetupZoom;
|
||||
yield return Def.ButtonGlygh.SetupAccel;
|
||||
yield return Def.ButtonGlygh.SetupReset;
|
||||
yield return Def.ButtonGlygh.SetupReturn;
|
||||
break;
|
||||
case Def.Phase.PlaySetup:
|
||||
yield return Def.ButtonGlygh.SetupSounds;
|
||||
yield return Def.ButtonGlygh.SetupJump;
|
||||
yield return Def.ButtonGlygh.SetupZoom;
|
||||
yield return Def.ButtonGlygh.SetupAccel;
|
||||
yield return Def.ButtonGlygh.SetupReturn;
|
||||
break;
|
||||
case Def.Phase.Ranking:
|
||||
yield return Def.ButtonGlygh.RankingContinue;
|
||||
break;
|
||||
}
|
||||
if (showCheatMenu)
|
||||
{
|
||||
yield return Def.ButtonGlygh.Cheat1;
|
||||
yield return Def.ButtonGlygh.Cheat2;
|
||||
yield return Def.ButtonGlygh.Cheat3;
|
||||
yield return Def.ButtonGlygh.Cheat4;
|
||||
yield return Def.ButtonGlygh.Cheat5;
|
||||
yield return Def.ButtonGlygh.Cheat6;
|
||||
yield return Def.ButtonGlygh.Cheat7;
|
||||
yield return Def.ButtonGlygh.Cheat8;
|
||||
yield return Def.ButtonGlygh.Cheat9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TinyPoint PadCenter
|
||||
{
|
||||
get
|
||||
{
|
||||
TinyRect drawBounds = pixmap.DrawBounds;
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyPoint result = default(TinyPoint);
|
||||
result.X = 100;
|
||||
result.Y = drawBounds.Height - 100;
|
||||
return result;
|
||||
}
|
||||
TinyPoint result2 = default(TinyPoint);
|
||||
result2.X = drawBounds.Width - 100;
|
||||
result2.Y = drawBounds.Height - 100;
|
||||
return result2;
|
||||
}
|
||||
}
|
||||
|
||||
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.ButtonGlygh>();
|
||||
accelSensor = AccelerometerFactory.Create();
|
||||
accelSensor.CurrentValueChanged += HandleAccelSensorCurrentValueChanged;
|
||||
accelSlider = new Slider
|
||||
{
|
||||
TopLeftCorner = new TinyPoint
|
||||
{
|
||||
X = 320,
|
||||
Y = 400
|
||||
},
|
||||
Value = this.gameData.AccelSensitivity
|
||||
};
|
||||
lastButtonDown = Def.ButtonGlygh.None;
|
||||
buttonPressed = Def.ButtonGlygh.None;
|
||||
}
|
||||
|
||||
public void StartMission(int mission)
|
||||
{
|
||||
this.mission = mission;
|
||||
accelWaitZero = true;
|
||||
}
|
||||
|
||||
private TinyPoint createTinyPoint(int x, int y)
|
||||
{
|
||||
TinyPoint tinyPoint = new TinyPoint();
|
||||
tinyPoint.X = x;
|
||||
tinyPoint.Y = y;
|
||||
return tinyPoint;
|
||||
}
|
||||
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 num3 = 0;
|
||||
padPressed = false;
|
||||
Def.ButtonGlygh buttonGlygh = Def.ButtonGlygh.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 tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = (int)item.Position.X;
|
||||
tinyPoint.Y = (int)item.Position.Y;
|
||||
touchesOrClicks.Add(tinyPoint);
|
||||
}
|
||||
}
|
||||
|
||||
MouseState mouseState = Mouse.GetState();
|
||||
if (mouseState.LeftButton == ButtonState.Pressed)
|
||||
{
|
||||
touchCount++;
|
||||
TinyPoint click = new TinyPoint();
|
||||
click.X = mouseState.X;
|
||||
click.Y = mouseState.Y;
|
||||
touchesOrClicks.Add(click);
|
||||
}
|
||||
|
||||
KeyboardState newState = Keyboard.GetState();
|
||||
{
|
||||
if (newState.IsKeyDown(Keys.LeftControl)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.LeftControl)));
|
||||
if (newState.IsKeyDown(Keys.Up)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.Up)));
|
||||
if (newState.IsKeyDown(Keys.Right)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.Right)));
|
||||
if (newState.IsKeyDown(Keys.Down)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.Down)));
|
||||
if (newState.IsKeyDown(Keys.Left)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.Left)));
|
||||
if (newState.IsKeyDown(Keys.Space)) touchesOrClicks.Add(createTinyPoint(-1, Misc.keyboardPressToInt(KeyboardPress.Space)));
|
||||
}
|
||||
if (newState.IsKeyDown(Keys.F11))
|
||||
{
|
||||
game1.ToggleFullScreen ();
|
||||
Debug.WriteLine("F11 was pressed.");
|
||||
}
|
||||
|
||||
Boolean keyPressedUp = false;
|
||||
Boolean keyPressedDown = false;
|
||||
Boolean keyPressedLeft = false;
|
||||
Boolean keyPressedRight = false;
|
||||
foreach (TinyPoint touchOrClick in touchesOrClicks)
|
||||
{
|
||||
Boolean keyboardPressed = false;
|
||||
if (touchOrClick.X == -1)
|
||||
{
|
||||
keyboardPressed = true;
|
||||
}
|
||||
KeyboardPress keyboardPress = keyboardPressed ? Misc.intToKeyboardPress(touchOrClick.Y) : KeyboardPress.None;
|
||||
keyPressedUp = keyboardPress == KeyboardPress.Up ? true : keyPressedUp;
|
||||
keyPressedDown = keyboardPress == KeyboardPress.Down ? true : keyPressedDown;
|
||||
keyPressedLeft = keyboardPress == KeyboardPress.Left ? true : keyPressedLeft;
|
||||
keyPressedRight = keyboardPress == KeyboardPress.Right ? true : keyPressedRight;
|
||||
|
||||
{
|
||||
TinyPoint tinyPoint2 = keyboardPressed ? createTinyPoint(1, 1) : touchOrClick;
|
||||
if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padSize), tinyPoint2))
|
||||
{
|
||||
padPressed = true;
|
||||
padTouchPos = tinyPoint2;
|
||||
}
|
||||
if (keyboardPress == KeyboardPress.Up || keyboardPress == KeyboardPress.Right || keyboardPress == KeyboardPress.Down || keyboardPress == KeyboardPress.Left)
|
||||
{
|
||||
padPressed = true;
|
||||
}
|
||||
Debug.WriteLine("padPressed=" + padPressed);
|
||||
Def.ButtonGlygh buttonGlygh2 = ButtonDetect(tinyPoint2);
|
||||
Debug.WriteLine("buttonGlyph2 =" + buttonGlygh2);
|
||||
if (buttonGlygh2 != 0)
|
||||
{
|
||||
pressedGlyphs.Add(buttonGlygh2);
|
||||
}
|
||||
if (keyboardPressed)
|
||||
{
|
||||
switch (keyboardPress)
|
||||
{
|
||||
case KeyboardPress.LeftControl: buttonGlygh2 = Def.ButtonGlygh.PlayJump; pressedGlyphs.Add(buttonGlygh2); break;
|
||||
case KeyboardPress.Space: buttonGlygh2 = Def.ButtonGlygh.PlayAction; pressedGlyphs.Add(buttonGlygh2); break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(tinyPoint2))
|
||||
{
|
||||
gameData.AccelSensitivity = accelSlider.Value;
|
||||
}
|
||||
switch (buttonGlygh2)
|
||||
{
|
||||
case Def.ButtonGlygh.PlayJump:
|
||||
Debug.WriteLine("Jumping detected");
|
||||
accelWaitZero = false;
|
||||
num3 |= 1;
|
||||
break;
|
||||
case Def.ButtonGlygh.PlayDown:
|
||||
accelWaitZero = false;
|
||||
num3 |= 4;
|
||||
break;
|
||||
case Def.ButtonGlygh.InitGamerA:
|
||||
case Def.ButtonGlygh.InitGamerB:
|
||||
case Def.ButtonGlygh.InitGamerC:
|
||||
case Def.ButtonGlygh.InitSetup:
|
||||
case Def.ButtonGlygh.InitPlay:
|
||||
case Def.ButtonGlygh.InitBuy:
|
||||
case Def.ButtonGlygh.InitRanking:
|
||||
case Def.ButtonGlygh.WinLostReturn:
|
||||
case Def.ButtonGlygh.TrialBuy:
|
||||
case Def.ButtonGlygh.TrialCancel:
|
||||
case Def.ButtonGlygh.SetupSounds:
|
||||
case Def.ButtonGlygh.SetupJump:
|
||||
case Def.ButtonGlygh.SetupZoom:
|
||||
case Def.ButtonGlygh.SetupAccel:
|
||||
case Def.ButtonGlygh.SetupReset:
|
||||
case Def.ButtonGlygh.SetupReturn:
|
||||
case Def.ButtonGlygh.PauseMenu:
|
||||
case Def.ButtonGlygh.PauseBack:
|
||||
case Def.ButtonGlygh.PauseSetup:
|
||||
case Def.ButtonGlygh.PauseRestart:
|
||||
case Def.ButtonGlygh.PauseContinue:
|
||||
case Def.ButtonGlygh.PlayPause:
|
||||
case Def.ButtonGlygh.PlayAction:
|
||||
case Def.ButtonGlygh.ResumeMenu:
|
||||
case Def.ButtonGlygh.ResumeContinue:
|
||||
case Def.ButtonGlygh.RankingContinue:
|
||||
case Def.ButtonGlygh.Cheat11:
|
||||
case Def.ButtonGlygh.Cheat12:
|
||||
case Def.ButtonGlygh.Cheat21:
|
||||
case Def.ButtonGlygh.Cheat22:
|
||||
case Def.ButtonGlygh.Cheat31:
|
||||
case Def.ButtonGlygh.Cheat32:
|
||||
case Def.ButtonGlygh.Cheat1:
|
||||
case Def.ButtonGlygh.Cheat2:
|
||||
case Def.ButtonGlygh.Cheat3:
|
||||
case Def.ButtonGlygh.Cheat4:
|
||||
case Def.ButtonGlygh.Cheat5:
|
||||
case Def.ButtonGlygh.Cheat6:
|
||||
case Def.ButtonGlygh.Cheat7:
|
||||
case Def.ButtonGlygh.Cheat8:
|
||||
case Def.ButtonGlygh.Cheat9:
|
||||
accelWaitZero = false;
|
||||
buttonGlygh = buttonGlygh2;
|
||||
showCheatMenu = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (buttonGlygh != 0 && buttonGlygh != Def.ButtonGlygh.PlayAction && buttonGlygh != Def.ButtonGlygh.Cheat11 && buttonGlygh != Def.ButtonGlygh.Cheat12 && buttonGlygh != Def.ButtonGlygh.Cheat21 && buttonGlygh != Def.ButtonGlygh.Cheat22 && buttonGlygh != Def.ButtonGlygh.Cheat31 && buttonGlygh != Def.ButtonGlygh.Cheat32 && lastButtonDown == Def.ButtonGlygh.None)
|
||||
{
|
||||
TinyPoint tinyPoint3 = default(TinyPoint);
|
||||
tinyPoint3.X = 320;
|
||||
tinyPoint3.Y = 240;
|
||||
TinyPoint pos = tinyPoint3;
|
||||
sound.PlayImage(0, pos);
|
||||
}
|
||||
if (buttonGlygh == Def.ButtonGlygh.None && lastButtonDown != 0)
|
||||
{
|
||||
buttonPressed = lastButtonDown;
|
||||
}
|
||||
lastButtonDown = buttonGlygh;
|
||||
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)num3 & 4u) != 0)
|
||||
{
|
||||
verticalChange = 1.0;
|
||||
}
|
||||
}
|
||||
decor.SetSpeedX(horizontalChange);
|
||||
decor.SetSpeedY(verticalChange);
|
||||
decor.KeyChange(num3);
|
||||
}
|
||||
|
||||
private Def.ButtonGlygh ButtonDetect(TinyPoint pos)
|
||||
{
|
||||
foreach (Def.ButtonGlygh item in ButtonGlyphs.Reverse())
|
||||
{
|
||||
int value = 0;
|
||||
if (item == Def.ButtonGlygh.PlayJump || item == Def.ButtonGlygh.PlayAction || item == Def.ButtonGlygh.PlayDown || item == Def.ButtonGlygh.PlayPause)
|
||||
{
|
||||
value = 20;
|
||||
}
|
||||
TinyRect rect = Misc.Inflate(GetButtonRect(item), value);
|
||||
if (Misc.IsInside(rect, pos))
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return Def.ButtonGlygh.None;
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (!accelStarted && Phase == Def.Phase.Play)
|
||||
{
|
||||
pixmap.DrawIcon(14, 0, GetPadBounds(PadCenter, padSize / 2), 1.0, false);
|
||||
TinyPoint center = (padPressed ? padTouchPos : PadCenter);
|
||||
pixmap.DrawIcon(14, 1, GetPadBounds(center, padSize / 2), 1.0, false);
|
||||
}
|
||||
foreach (Def.ButtonGlygh buttonGlyph in ButtonGlyphs)
|
||||
{
|
||||
bool pressed = pressedGlyphs.Contains(buttonGlyph);
|
||||
bool selected = false;
|
||||
if (buttonGlyph >= Def.ButtonGlygh.InitGamerA && buttonGlyph <= Def.ButtonGlygh.InitGamerC)
|
||||
{
|
||||
int num = (int)(buttonGlyph - 1);
|
||||
selected = num == gameData.SelectedGamer;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlygh.SetupSounds)
|
||||
{
|
||||
selected = gameData.Sounds;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlygh.SetupJump)
|
||||
{
|
||||
selected = gameData.JumpRight;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlygh.SetupZoom)
|
||||
{
|
||||
selected = gameData.AutoZoom;
|
||||
}
|
||||
if (buttonGlyph == Def.ButtonGlygh.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)
|
||||
{
|
||||
TinyRect result = default(TinyRect);
|
||||
result.Left = center.X - radius;
|
||||
result.Right = center.X + radius;
|
||||
result.Top = center.Y - radius;
|
||||
result.Bottom = center.Y + radius;
|
||||
return result;
|
||||
}
|
||||
|
||||
public TinyRect GetButtonRect(Def.ButtonGlygh glyph)
|
||||
{
|
||||
TinyRect drawBounds = pixmap.DrawBounds;
|
||||
double num = drawBounds.Width;
|
||||
double num2 = drawBounds.Height;
|
||||
double num3 = num2 / 5.0;
|
||||
double num4 = num2 * 140.0 / 480.0;
|
||||
double num5 = num2 / 3.5;
|
||||
if (glyph >= Def.ButtonGlygh.Cheat1 && glyph <= Def.ButtonGlygh.Cheat9)
|
||||
{
|
||||
int num6 = (int)(glyph - 35);
|
||||
TinyRect result = default(TinyRect);
|
||||
result.Left = 80 * num6;
|
||||
result.Right = 80 * (num6 + 1);
|
||||
result.Top = 0;
|
||||
result.Bottom = 80;
|
||||
return result;
|
||||
}
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlygh.InitGamerA:
|
||||
{
|
||||
TinyRect result19 = default(TinyRect);
|
||||
result19.Left = (int)(20.0 + num4 * 0.0);
|
||||
result19.Right = (int)(20.0 + num4 * 0.5);
|
||||
result19.Top = (int)(num2 - 20.0 - num4 * 2.1);
|
||||
result19.Bottom = (int)(num2 - 20.0 - num4 * 1.6);
|
||||
return result19;
|
||||
}
|
||||
case Def.ButtonGlygh.InitGamerB:
|
||||
{
|
||||
TinyRect result18 = default(TinyRect);
|
||||
result18.Left = (int)(20.0 + num4 * 0.0);
|
||||
result18.Right = (int)(20.0 + num4 * 0.5);
|
||||
result18.Top = (int)(num2 - 20.0 - num4 * 1.6);
|
||||
result18.Bottom = (int)(num2 - 20.0 - num4 * 1.1);
|
||||
return result18;
|
||||
}
|
||||
case Def.ButtonGlygh.InitGamerC:
|
||||
{
|
||||
TinyRect result15 = default(TinyRect);
|
||||
result15.Left = (int)(20.0 + num4 * 0.0);
|
||||
result15.Right = (int)(20.0 + num4 * 0.5);
|
||||
result15.Top = (int)(num2 - 20.0 - num4 * 1.1);
|
||||
result15.Bottom = (int)(num2 - 20.0 - num4 * 0.6);
|
||||
return result15;
|
||||
}
|
||||
case Def.ButtonGlygh.InitSetup:
|
||||
{
|
||||
TinyRect result14 = default(TinyRect);
|
||||
result14.Left = (int)(20.0 + num4 * 0.0);
|
||||
result14.Right = (int)(20.0 + num4 * 0.5);
|
||||
result14.Top = (int)(num2 - 20.0 - num4 * 0.5);
|
||||
result14.Bottom = (int)(num2 - 20.0 - num4 * 0.0);
|
||||
return result14;
|
||||
}
|
||||
case Def.ButtonGlygh.InitPlay:
|
||||
{
|
||||
TinyRect result11 = default(TinyRect);
|
||||
result11.Left = (int)(num - 20.0 - num4 * 1.0);
|
||||
result11.Right = (int)(num - 20.0 - num4 * 0.0);
|
||||
result11.Top = (int)(num2 - 40.0 - num4 * 1.0);
|
||||
result11.Bottom = (int)(num2 - 40.0 - num4 * 0.0);
|
||||
return result11;
|
||||
}
|
||||
case Def.ButtonGlygh.InitBuy:
|
||||
case Def.ButtonGlygh.InitRanking:
|
||||
{
|
||||
TinyRect result10 = default(TinyRect);
|
||||
result10.Left = (int)(num - 20.0 - num4 * 0.75);
|
||||
result10.Right = (int)(num - 20.0 - num4 * 0.25);
|
||||
result10.Top = (int)(num2 - 20.0 - num4 * 2.1);
|
||||
result10.Bottom = (int)(num2 - 20.0 - num4 * 1.6);
|
||||
return result10;
|
||||
}
|
||||
case Def.ButtonGlygh.PauseMenu:
|
||||
{
|
||||
TinyRect result37 = default(TinyRect);
|
||||
result37.Left = (int)((double)PixmapOrigin.X + num4 * -0.21);
|
||||
result37.Right = (int)((double)PixmapOrigin.X + num4 * 0.79);
|
||||
result37.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result37.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result37;
|
||||
}
|
||||
case Def.ButtonGlygh.PauseBack:
|
||||
{
|
||||
TinyRect result36 = default(TinyRect);
|
||||
result36.Left = (int)((double)PixmapOrigin.X + num4 * 0.79);
|
||||
result36.Right = (int)((double)PixmapOrigin.X + num4 * 1.79);
|
||||
result36.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result36.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result36;
|
||||
}
|
||||
case Def.ButtonGlygh.PauseSetup:
|
||||
{
|
||||
TinyRect result35 = default(TinyRect);
|
||||
result35.Left = (int)((double)PixmapOrigin.X + num4 * 1.79);
|
||||
result35.Right = (int)((double)PixmapOrigin.X + num4 * 2.79);
|
||||
result35.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result35.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result35;
|
||||
}
|
||||
case Def.ButtonGlygh.PauseRestart:
|
||||
{
|
||||
TinyRect result34 = default(TinyRect);
|
||||
result34.Left = (int)((double)PixmapOrigin.X + num4 * 2.79);
|
||||
result34.Right = (int)((double)PixmapOrigin.X + num4 * 3.79);
|
||||
result34.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result34.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result34;
|
||||
}
|
||||
case Def.ButtonGlygh.PauseContinue:
|
||||
{
|
||||
TinyRect result33 = default(TinyRect);
|
||||
result33.Left = (int)((double)PixmapOrigin.X + num4 * 3.79);
|
||||
result33.Right = (int)((double)PixmapOrigin.X + num4 * 4.79);
|
||||
result33.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result33.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result33;
|
||||
}
|
||||
case Def.ButtonGlygh.ResumeMenu:
|
||||
{
|
||||
TinyRect result32 = default(TinyRect);
|
||||
result32.Left = (int)((double)PixmapOrigin.X + num4 * 1.29);
|
||||
result32.Right = (int)((double)PixmapOrigin.X + num4 * 2.29);
|
||||
result32.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result32.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result32;
|
||||
}
|
||||
case Def.ButtonGlygh.ResumeContinue:
|
||||
{
|
||||
TinyRect result31 = default(TinyRect);
|
||||
result31.Left = (int)((double)PixmapOrigin.X + num4 * 2.29);
|
||||
result31.Right = (int)((double)PixmapOrigin.X + num4 * 3.29);
|
||||
result31.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2);
|
||||
result31.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2);
|
||||
return result31;
|
||||
}
|
||||
case Def.ButtonGlygh.WinLostReturn:
|
||||
{
|
||||
TinyRect result30 = default(TinyRect);
|
||||
result30.Left = (int)((double)PixmapOrigin.X + num - num3 * 2.2);
|
||||
result30.Right = (int)((double)PixmapOrigin.X + num - num3 * 1.2);
|
||||
result30.Top = (int)((double)PixmapOrigin.Y + num3 * 0.2);
|
||||
result30.Bottom = (int)((double)PixmapOrigin.Y + num3 * 1.2);
|
||||
return result30;
|
||||
}
|
||||
case Def.ButtonGlygh.TrialBuy:
|
||||
{
|
||||
TinyRect result29 = default(TinyRect);
|
||||
result29.Left = (int)((double)PixmapOrigin.X + num4 * 2.5);
|
||||
result29.Right = (int)((double)PixmapOrigin.X + num4 * 3.5);
|
||||
result29.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1);
|
||||
result29.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1);
|
||||
return result29;
|
||||
}
|
||||
case Def.ButtonGlygh.TrialCancel:
|
||||
{
|
||||
TinyRect result28 = default(TinyRect);
|
||||
result28.Left = (int)((double)PixmapOrigin.X + num4 * 3.5);
|
||||
result28.Right = (int)((double)PixmapOrigin.X + num4 * 4.5);
|
||||
result28.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1);
|
||||
result28.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1);
|
||||
return result28;
|
||||
}
|
||||
case Def.ButtonGlygh.RankingContinue:
|
||||
{
|
||||
TinyRect result27 = default(TinyRect);
|
||||
result27.Left = (int)((double)PixmapOrigin.X + num4 * 3.5);
|
||||
result27.Right = (int)((double)PixmapOrigin.X + num4 * 4.5);
|
||||
result27.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1);
|
||||
result27.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1);
|
||||
return result27;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupSounds:
|
||||
{
|
||||
TinyRect result26 = default(TinyRect);
|
||||
result26.Left = (int)(20.0 + num4 * 0.0);
|
||||
result26.Right = (int)(20.0 + num4 * 0.5);
|
||||
result26.Top = (int)(num2 - 20.0 - num4 * 2.0);
|
||||
result26.Bottom = (int)(num2 - 20.0 - num4 * 1.5);
|
||||
return result26;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupJump:
|
||||
{
|
||||
TinyRect result25 = default(TinyRect);
|
||||
result25.Left = (int)(20.0 + num4 * 0.0);
|
||||
result25.Right = (int)(20.0 + num4 * 0.5);
|
||||
result25.Top = (int)(num2 - 20.0 - num4 * 1.5);
|
||||
result25.Bottom = (int)(num2 - 20.0 - num4 * 1.0);
|
||||
return result25;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupZoom:
|
||||
{
|
||||
TinyRect result24 = default(TinyRect);
|
||||
result24.Left = (int)(20.0 + num4 * 0.0);
|
||||
result24.Right = (int)(20.0 + num4 * 0.5);
|
||||
result24.Top = (int)(num2 - 20.0 - num4 * 1.0);
|
||||
result24.Bottom = (int)(num2 - 20.0 - num4 * 0.5);
|
||||
return result24;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupAccel:
|
||||
{
|
||||
TinyRect result23 = default(TinyRect);
|
||||
result23.Left = (int)(20.0 + num4 * 0.0);
|
||||
result23.Right = (int)(20.0 + num4 * 0.5);
|
||||
result23.Top = (int)(num2 - 20.0 - num4 * 0.5);
|
||||
result23.Bottom = (int)(num2 - 20.0 - num4 * 0.0);
|
||||
return result23;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupReset:
|
||||
{
|
||||
TinyRect result22 = default(TinyRect);
|
||||
result22.Left = (int)(450.0 + num4 * 0.0);
|
||||
result22.Right = (int)(450.0 + num4 * 0.5);
|
||||
result22.Top = (int)(num2 - 20.0 - num4 * 2.0);
|
||||
result22.Bottom = (int)(num2 - 20.0 - num4 * 1.5);
|
||||
return result22;
|
||||
}
|
||||
case Def.ButtonGlygh.SetupReturn:
|
||||
{
|
||||
TinyRect result21 = default(TinyRect);
|
||||
result21.Left = (int)(num - 20.0 - num4 * 0.8);
|
||||
result21.Right = (int)(num - 20.0 - num4 * 0.0);
|
||||
result21.Top = (int)(num2 - 20.0 - num4 * 0.8);
|
||||
result21.Bottom = (int)(num2 - 20.0 - num4 * 0.0);
|
||||
return result21;
|
||||
}
|
||||
case Def.ButtonGlygh.PlayPause:
|
||||
{
|
||||
TinyRect result20 = default(TinyRect);
|
||||
result20.Left = (int)(num - num3 * 0.7);
|
||||
result20.Right = (int)(num - num3 * 0.2);
|
||||
result20.Top = (int)(num3 * 0.2);
|
||||
result20.Bottom = (int)(num3 * 0.7);
|
||||
return result20;
|
||||
}
|
||||
case Def.ButtonGlygh.PlayAction:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result16 = default(TinyRect);
|
||||
result16.Left = (int)((double)drawBounds.Width - num3 * 1.2);
|
||||
result16.Right = (int)((double)drawBounds.Width - num3 * 0.2);
|
||||
result16.Top = (int)(num2 - num3 * 2.6);
|
||||
result16.Bottom = (int)(num2 - num3 * 1.6);
|
||||
return result16;
|
||||
}
|
||||
TinyRect result17 = default(TinyRect);
|
||||
result17.Left = (int)(num3 * 0.2);
|
||||
result17.Right = (int)(num3 * 1.2);
|
||||
result17.Top = (int)(num2 - num3 * 2.6);
|
||||
result17.Bottom = (int)(num2 - num3 * 1.6);
|
||||
return result17;
|
||||
}
|
||||
case Def.ButtonGlygh.PlayJump:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result12 = default(TinyRect);
|
||||
result12.Left = (int)((double)drawBounds.Width - num3 * 1.2);
|
||||
result12.Right = (int)((double)drawBounds.Width - num3 * 0.2);
|
||||
result12.Top = (int)(num2 - num3 * 1.2);
|
||||
result12.Bottom = (int)(num2 - num3 * 0.2);
|
||||
return result12;
|
||||
}
|
||||
TinyRect result13 = default(TinyRect);
|
||||
result13.Left = (int)(num3 * 0.2);
|
||||
result13.Right = (int)(num3 * 1.2);
|
||||
result13.Top = (int)(num2 - num3 * 1.2);
|
||||
result13.Bottom = (int)(num2 - num3 * 0.2);
|
||||
return result13;
|
||||
}
|
||||
case Def.ButtonGlygh.PlayDown:
|
||||
{
|
||||
if (gameData.JumpRight)
|
||||
{
|
||||
TinyRect result8 = default(TinyRect);
|
||||
result8.Left = (int)(num3 * 0.2);
|
||||
result8.Right = (int)(num3 * 1.2);
|
||||
result8.Top = (int)(num2 - num3 * 1.2);
|
||||
result8.Bottom = (int)(num2 - num3 * 0.2);
|
||||
return result8;
|
||||
}
|
||||
TinyRect result9 = default(TinyRect);
|
||||
result9.Left = (int)((double)drawBounds.Width - num3 * 1.2);
|
||||
result9.Right = (int)((double)drawBounds.Width - num3 * 0.2);
|
||||
result9.Top = (int)(num2 - num3 * 1.2);
|
||||
result9.Bottom = (int)(num2 - num3 * 0.2);
|
||||
return result9;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat11:
|
||||
{
|
||||
TinyRect result7 = default(TinyRect);
|
||||
result7.Left = (int)(num5 * 0.0);
|
||||
result7.Right = (int)(num5 * 1.0);
|
||||
result7.Top = (int)(num5 * 0.0);
|
||||
result7.Bottom = (int)(num5 * 1.0);
|
||||
return result7;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat12:
|
||||
{
|
||||
TinyRect result6 = default(TinyRect);
|
||||
result6.Left = (int)(num5 * 0.0);
|
||||
result6.Right = (int)(num5 * 1.0);
|
||||
result6.Top = (int)(num5 * 1.0);
|
||||
result6.Bottom = (int)(num5 * 2.0);
|
||||
return result6;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat21:
|
||||
{
|
||||
TinyRect result5 = default(TinyRect);
|
||||
result5.Left = (int)(num5 * 1.0);
|
||||
result5.Right = (int)(num5 * 2.0);
|
||||
result5.Top = (int)(num5 * 0.0);
|
||||
result5.Bottom = (int)(num5 * 1.0);
|
||||
return result5;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat22:
|
||||
{
|
||||
TinyRect result4 = default(TinyRect);
|
||||
result4.Left = (int)(num5 * 1.0);
|
||||
result4.Right = (int)(num5 * 2.0);
|
||||
result4.Top = (int)(num5 * 1.0);
|
||||
result4.Bottom = (int)(num5 * 2.0);
|
||||
return result4;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat31:
|
||||
{
|
||||
TinyRect result3 = default(TinyRect);
|
||||
result3.Left = (int)(num5 * 2.0);
|
||||
result3.Right = (int)(num5 * 3.0);
|
||||
result3.Top = (int)(num5 * 0.0);
|
||||
result3.Bottom = (int)(num5 * 1.0);
|
||||
return result3;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat32:
|
||||
{
|
||||
TinyRect result2 = default(TinyRect);
|
||||
result2.Left = (int)(num5 * 2.0);
|
||||
result2.Right = (int)(num5 * 3.0);
|
||||
result2.Top = (int)(num5 * 1.0);
|
||||
result2.Bottom = (int)(num5 * 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, AccelerometerEventArgs 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)
|
||||
|
||||
float y = e.Y;
|
||||
float num = (1f - (float)gameData.AccelSensitivity) * 0.06f + 0.04f;
|
||||
float num2 = (accelLastState ? (num * 0.6f) : num);
|
||||
if (y > num2)
|
||||
{
|
||||
accelSpeedX = 0.0 - Math.Min((double)y * 0.25 / (double)num + 0.25, 1.0);
|
||||
}
|
||||
else if (y < 0f - num2)
|
||||
{
|
||||
accelSpeedX = Math.Min((double)(0f - y) * 0.25 / (double)num + 0.25, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
accelSpeedX = 0.0;
|
||||
}
|
||||
accelLastState = accelSpeedX != 0.0;
|
||||
if (accelWaitZero)
|
||||
{
|
||||
if (accelSpeedX == 0.0)
|
||||
{
|
||||
accelWaitZero = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
accelSpeedX = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
// 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.Left = 0;
|
||||
rect.Right = 124;
|
||||
rect.Top = 0;
|
||||
rect.Bottom = 22;
|
||||
m_pixmap.DrawPart(5, m_pos, rect, m_zoom);
|
||||
if (num > 0)
|
||||
{
|
||||
rect.Left = 0;
|
||||
rect.Right = 6 + num;
|
||||
rect.Top = 22 * m_mode;
|
||||
rect.Bottom = 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class MarketPlace
|
||||
{
|
||||
public static void Show(PlayerIndex playerIndex)
|
||||
{
|
||||
//Guide.ShowMarketplace(PlayerIndex.One);
|
||||
Debug.Write("The Market Place should be shown.");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Misc
|
||||
using System;
|
||||
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.Left = rect.Left - value;
|
||||
result.Right = rect.Right + value;
|
||||
result.Top = rect.Top - value;
|
||||
result.Bottom = rect.Bottom + value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool IsInside(TinyRect rect, TinyPoint p)
|
||||
{
|
||||
if (p.X >= rect.Left && p.X <= rect.Right && p.Y >= rect.Top)
|
||||
{
|
||||
return p.Y <= rect.Bottom;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IntersectRect(out TinyRect dst, TinyRect src1, TinyRect src2)
|
||||
{
|
||||
dst = default(TinyRect);
|
||||
dst.Left = Math.Max(src1.Left, src2.Left);
|
||||
dst.Right = Math.Min(src1.Right, src2.Right);
|
||||
dst.Top = Math.Max(src1.Top, src2.Top);
|
||||
dst.Bottom = Math.Min(src1.Bottom, src2.Bottom);
|
||||
return !IsRectEmpty(dst);
|
||||
}
|
||||
|
||||
public static bool UnionRect(out TinyRect dst, TinyRect src1, TinyRect src2)
|
||||
{
|
||||
dst = default(TinyRect);
|
||||
dst.Left = Math.Min(src1.Left, src2.Left);
|
||||
dst.Right = Math.Max(src1.Right, src2.Right);
|
||||
dst.Top = Math.Min(src1.Top, src2.Top);
|
||||
dst.Bottom = Math.Max(src1.Bottom, src2.Bottom);
|
||||
return !IsRectEmpty(dst);
|
||||
}
|
||||
|
||||
private static bool IsRectEmpty(TinyRect rect)
|
||||
{
|
||||
if (rect.Left < rect.Right)
|
||||
{
|
||||
return rect.Top >= rect.Bottom;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static KeyboardPress intToKeyboardPress(int i) {
|
||||
switch (i)
|
||||
{
|
||||
case 0: return KeyboardPress.None;
|
||||
case 1: return KeyboardPress.Up;
|
||||
case 2: return KeyboardPress.Right;
|
||||
case 3: return KeyboardPress.Down;
|
||||
case 4: return KeyboardPress.Left;
|
||||
case 5: return KeyboardPress.LeftControl;
|
||||
case 6: return KeyboardPress.Space;
|
||||
case 7: return KeyboardPress.Escape;
|
||||
case 8: return KeyboardPress.Pause;
|
||||
default: throw new Exception("Unsupported number for KeyboardPress: " + i);
|
||||
}
|
||||
}
|
||||
public static int keyboardPressToInt(KeyboardPress kp)
|
||||
{
|
||||
switch (kp)
|
||||
{
|
||||
case KeyboardPress.None: return 0;
|
||||
case KeyboardPress.Up: return 1;
|
||||
case KeyboardPress.Right: return 2;
|
||||
case KeyboardPress.Down: return 3;
|
||||
case KeyboardPress.Left: return 4;
|
||||
case KeyboardPress.LeftControl: return 5;
|
||||
case KeyboardPress.Space: return 6;
|
||||
case KeyboardPress.Escape: return 7;
|
||||
case KeyboardPress.Pause: return 8;
|
||||
default: throw new Exception("Unsupported KeyboardPress: " + kp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,776 @@
|
||||
// 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, "");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,561 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Pixmap
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
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 num = graphics.GraphicsDevice.Viewport.Width;
|
||||
double num2 = graphics.GraphicsDevice.Viewport.Height;
|
||||
if (num != 0.0 && num2 != 0.0)
|
||||
{
|
||||
double num3;
|
||||
double num4;
|
||||
if (num / num2 < 1.3333333333333333)
|
||||
{
|
||||
num3 = 640.0;
|
||||
num4 = 640.0 * (num2 / num);
|
||||
}
|
||||
else
|
||||
{
|
||||
num3 = 480.0 * (num / num2);
|
||||
num4 = 480.0;
|
||||
}
|
||||
result.Left = 0;
|
||||
result.Right = (int)num3;
|
||||
result.Top = 0;
|
||||
result.Bottom = (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.ButtonGlygh glyph, bool pressed, bool selected)
|
||||
{
|
||||
switch (glyph)
|
||||
{
|
||||
case Def.ButtonGlygh.InitGamerA:
|
||||
DrawIcon(14, selected ? 16 : 4, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitGamerB:
|
||||
DrawIcon(14, selected ? 17 : 5, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitGamerC:
|
||||
DrawIcon(14, selected ? 18 : 6, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitSetup:
|
||||
case Def.ButtonGlygh.PauseSetup:
|
||||
DrawIcon(14, 19, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitPlay:
|
||||
DrawIcon(14, 7, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PauseMenu:
|
||||
case Def.ButtonGlygh.ResumeMenu:
|
||||
DrawIcon(14, 11, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PauseBack:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PauseRestart:
|
||||
DrawIcon(14, 9, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PauseContinue:
|
||||
case Def.ButtonGlygh.ResumeContinue:
|
||||
DrawIcon(14, 10, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.WinLostReturn:
|
||||
DrawIcon(14, 3, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitBuy:
|
||||
case Def.ButtonGlygh.TrialBuy:
|
||||
DrawIcon(14, 22, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.InitRanking:
|
||||
DrawIcon(14, 12, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.TrialCancel:
|
||||
case Def.ButtonGlygh.RankingContinue:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.SetupSounds:
|
||||
case Def.ButtonGlygh.SetupJump:
|
||||
case Def.ButtonGlygh.SetupZoom:
|
||||
case Def.ButtonGlygh.SetupAccel:
|
||||
DrawIcon(14, selected ? 13 : 21, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.SetupReset:
|
||||
DrawIcon(14, 20, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.SetupReturn:
|
||||
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PlayJump:
|
||||
DrawIcon(14, 2, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PlayAction:
|
||||
DrawIcon(14, 12, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PlayDown:
|
||||
DrawIcon(14, 23, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.PlayPause:
|
||||
DrawIcon(14, 3, rect, pressed ? 0.6 : 1.0, false);
|
||||
break;
|
||||
case Def.ButtonGlygh.Cheat1:
|
||||
case Def.ButtonGlygh.Cheat2:
|
||||
case Def.ButtonGlygh.Cheat3:
|
||||
case Def.ButtonGlygh.Cheat4:
|
||||
case Def.ButtonGlygh.Cheat5:
|
||||
case Def.ButtonGlygh.Cheat6:
|
||||
case Def.ButtonGlygh.Cheat7:
|
||||
case Def.ButtonGlygh.Cheat8:
|
||||
case Def.ButtonGlygh.Cheat9:
|
||||
{
|
||||
DrawIcon(14, 0, rect, pressed ? 0.6 : 1.0, false);
|
||||
TinyPoint tinyPoint = default(TinyPoint);
|
||||
tinyPoint.X = rect.Left + rect.Width / 2 - (int)originX;
|
||||
tinyPoint.Y = rect.Top + 28;
|
||||
TinyPoint pos = tinyPoint;
|
||||
Text.DrawTextCenter(this, pos, Decor.GetCheatTinyText(glyph), 1.0);
|
||||
break;
|
||||
}
|
||||
case Def.ButtonGlygh.Cheat11:
|
||||
case Def.ButtonGlygh.Cheat12:
|
||||
case Def.ButtonGlygh.Cheat21:
|
||||
case Def.ButtonGlygh.Cheat22:
|
||||
case Def.ButtonGlygh.Cheat31:
|
||||
case Def.ButtonGlygh.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 num = graphics.GraphicsDevice.Viewport.Width;
|
||||
double num2 = graphics.GraphicsDevice.Viewport.Height;
|
||||
double val = num / 640.0;
|
||||
double val2 = num2 / 480.0;
|
||||
zoom = Math.Min(val, val2);
|
||||
originX = (num - 640.0 * zoom) / 2.0;
|
||||
originY = (num2 - 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 num = graphics.GraphicsDevice.Viewport.Width;
|
||||
double num2 = graphics.GraphicsDevice.Viewport.Height;
|
||||
Texture2D bitmap = GetBitmap(3);
|
||||
Rectangle srcRectangle = GetSrcRectangle(bitmap, 10, 10, 10, 10, 0, 0);
|
||||
Rectangle destinationRectangle = new Rectangle(0, 0, (int)num, (int)num2);
|
||||
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.Left = 0;
|
||||
tinyRect.Top = 0;
|
||||
tinyRect.Right = 640;
|
||||
tinyRect.Bottom = 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.Left = pos.X;
|
||||
tinyRect.Top = pos.Y;
|
||||
tinyRect.Right = pos.X + (int)(32.0 * size);
|
||||
tinyRect.Bottom = 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.Left = pos.X;
|
||||
tinyRect.Top = pos.Y;
|
||||
tinyRect.Right = pos.X;
|
||||
tinyRect.Bottom = 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.Left = pos.X;
|
||||
tinyRect.Top = pos.Y;
|
||||
tinyRect.Right = pos.X;
|
||||
tinyRect.Bottom = 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.Left = pos.X;
|
||||
tinyRect.Top = pos.Y;
|
||||
tinyRect.Right = pos.X;
|
||||
tinyRect.Bottom = 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.Left, rect.Top, 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.Left * zoom);
|
||||
int num4 = (int)((double)rect.Top * 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
using var game = new WindowsPhoneSpeedyBlupi.Game1();
|
||||
game.Run();
|
@ -0,0 +1,63 @@
|
||||
// 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;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
//[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 (object.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()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.Slider
|
||||
using System;
|
||||
using WindowsPhoneSpeedyBlupi;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class Slider
|
||||
{
|
||||
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.Left = 0;
|
||||
tinyRect.Right = 124;
|
||||
tinyRect.Top = 0;
|
||||
tinyRect.Bottom = 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.Left = PosLeft + num - num3 / 2;
|
||||
tinyRect2.Right = PosLeft + num + num3 / 2;
|
||||
tinyRect2.Top = num2 - num3 / 2;
|
||||
tinyRect2.Bottom = num2 + num3 / 2;
|
||||
rect = tinyRect2;
|
||||
pixmap.DrawIcon(14, 1, rect, 1.0, false);
|
||||
TinyRect tinyRect3 = default(TinyRect);
|
||||
tinyRect3.Left = TopLeftCorner.X - 65;
|
||||
tinyRect3.Right = TopLeftCorner.X - 65 + 60;
|
||||
tinyRect3.Top = TopLeftCorner.Y - 10;
|
||||
tinyRect3.Bottom = TopLeftCorner.Y - 10 + 60;
|
||||
rect = tinyRect3;
|
||||
pixmap.DrawIcon(10, 37, rect, 1.0, false);
|
||||
TinyRect tinyRect4 = default(TinyRect);
|
||||
tinyRect4.Left = TopLeftCorner.X + 248 + 5;
|
||||
tinyRect4.Right = TopLeftCorner.X + 248 + 5 + 60;
|
||||
tinyRect4.Top = TopLeftCorner.Y - 10;
|
||||
tinyRect4.Bottom = TopLeftCorner.Y - 10 + 60;
|
||||
rect = tinyRect4;
|
||||
pixmap.DrawIcon(10, 38, rect, 1.0, false);
|
||||
}
|
||||
|
||||
public bool Move(TinyPoint pos)
|
||||
{
|
||||
TinyRect tinyRect = default(TinyRect);
|
||||
tinyRect.Left = TopLeftCorner.X - 50;
|
||||
tinyRect.Right = TopLeftCorner.X + 248 + 50;
|
||||
tinyRect.Top = TopLeftCorner.Y - 50;
|
||||
tinyRect.Bottom = 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,260 @@
|
||||
// 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
@ -0,0 +1,295 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.TinyPoint
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public struct TinyPoint
|
||||
{
|
||||
public int X;
|
||||
|
||||
public int Y;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0};{1}", X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
|
||||
// WindowsPhoneSpeedyBlupi.TinyRect
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public struct TinyRect
|
||||
{
|
||||
public int Left;
|
||||
|
||||
public int Right;
|
||||
|
||||
public int Top;
|
||||
|
||||
public int Bottom;
|
||||
|
||||
public int Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return Right - Left;
|
||||
}
|
||||
}
|
||||
|
||||
public int Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return Bottom - Top;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0};{1};{2};{3}", Left, Top, Right, Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace WindowsPhoneSpeedyBlupi
|
||||
{
|
||||
public class TrialMode
|
||||
{
|
||||
private static DateTime trialStartTime;
|
||||
|
||||
public static void InitializeTrialMode()
|
||||
{
|
||||
// Assuming trial mode starts when the game is launched
|
||||
trialStartTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public static Boolean IsTrialModeExpired()
|
||||
{
|
||||
return IsTrialMode7DaysLimitExpired() || IsTrialMode10MinutesLimitExpired();
|
||||
}
|
||||
private static bool IsTrialMode10MinutesLimitExpired()
|
||||
{
|
||||
// Example: Trial expires after 10 minutes
|
||||
var expired = (DateTime.Now - trialStartTime).TotalMinutes > 10;
|
||||
return expired;
|
||||
}
|
||||
private static bool IsTrialMode7DaysLimitExpired()
|
||||
{
|
||||
// Save trial expiration status to a file or settings
|
||||
const string TRIAL_END_TIME_TXT = "trialEndTime.txt";
|
||||
var trialEndTime = File.Exists(TRIAL_END_TIME_TXT) ? DateTime.Parse(File.ReadAllText(TRIAL_END_TIME_TXT)) : DateTime.MinValue;
|
||||
|
||||
var expired = trialEndTime != DateTime.MinValue && DateTime.Now > trialEndTime;
|
||||
if (expired)
|
||||
{
|
||||
return true; // Trial period is over
|
||||
}
|
||||
|
||||
// Example of setting trial end time (e.g., 7 days from now)
|
||||
if (!File.Exists(TRIAL_END_TIME_TXT))
|
||||
{
|
||||
File.WriteAllText(TRIAL_END_TIME_TXT, DateTime.Now.AddDays(7).ToString());
|
||||
}
|
||||
|
||||
return false; // Trial period still active
|
||||
}
|
||||
private static int trialModeEnabled = -1;
|
||||
public static bool IsTrialModeEnabled()
|
||||
{
|
||||
if(trialModeEnabled == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (trialModeEnabled == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const string TRIAL_MODE_ENABLED_TXT = "trialModeEnabled.txt";
|
||||
var trialModeEnabledString = File.Exists(TRIAL_MODE_ENABLED_TXT) ? File.ReadAllText(TRIAL_MODE_ENABLED_TXT) : "0";
|
||||
var trialModeEnabledLocal = trialModeEnabledString.Equals("1");
|
||||
trialModeEnabled = trialModeEnabledLocal ? 1 : 0;
|
||||
|
||||
return trialModeEnabledLocal;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,464 @@
|
||||
// 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
|
||||
{
|
||||
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(TinyPoint);
|
||||
}
|
||||
num += name.Length + 1;
|
||||
int num2 = text.IndexOf(";", num);
|
||||
if (num2 == -1)
|
||||
{
|
||||
return default(TinyPoint);
|
||||
}
|
||||
int num3 = text.IndexOf(" ", num);
|
||||
if (num3 == -1)
|
||||
{
|
||||
return default(TinyPoint);
|
||||
}
|
||||
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(TinyPoint);
|
||||
}
|
||||
int result2;
|
||||
if (!int.TryParse(s2, out result2))
|
||||
{
|
||||
return default(TinyPoint);
|
||||
}
|
||||
TinyPoint result3 = default(TinyPoint);
|
||||
result3.X = result;
|
||||
result3.Y = result2;
|
||||
return result3;
|
||||
}
|
||||
}
|
||||
return default(TinyPoint);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user