diff --git a/Decor.cs b/Decor.cs index 15b7b44..2d236d7 100644 --- a/Decor.cs +++ b/Decor.cs @@ -4318,7 +4318,7 @@ namespace WindowsPhoneSpeedyBlupi m_blupiSuspend = false; m_blupiAir = true; m_blupiAction = 5; - end.Y = end.Y; + end.Y = end.Y;//Todo : check : Assignment made to same variable; did you mean to assign something else? m_blupiVitesseY = 0.0; m_blupiNoBarre = 5; m_blupiActionOuf = 65; diff --git a/Game1.cs b/Game1.cs index 094c3bd..d84850d 100644 --- a/Game1.cs +++ b/Game1.cs @@ -2,7 +2,7 @@ // WindowsPhoneSpeedyBlupi.Game1 using System; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.GamerServices; +//using Microsoft.Xna.Framework.GamerServices;//todo remove me using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using WindowsPhoneSpeedyBlupi; @@ -97,6 +97,7 @@ namespace WindowsPhoneSpeedyBlupi public Game1() { + Exiting += OnExiting; graphics = new GraphicsDeviceManager(this); graphics.IsFullScreen = true; base.Content.RootDirectory = "Content"; @@ -157,10 +158,9 @@ namespace WindowsPhoneSpeedyBlupi base.OnActivated(sender, args); } - protected override void OnExiting(object sender, EventArgs args) + protected void OnExiting(object sender, EventArgs args) { decor.CurrentDelete(); - base.OnExiting(sender, args); } protected override void Update(GameTime gameTime) @@ -292,7 +292,7 @@ namespace WindowsPhoneSpeedyBlupi return; case Def.ButtonGlygh.InitBuy: case Def.ButtonGlygh.TrialBuy: - Guide.ShowMarketplace(PlayerIndex.One); + MarketPlace.Show(PlayerIndex.One); SetPhase(Def.Phase.Init); return; case Def.ButtonGlygh.InitRanking: @@ -918,7 +918,7 @@ namespace WindowsPhoneSpeedyBlupi fadeOutPhase = Def.Phase.None; inputPad.Phase = this.phase; playSetup = this.phase == Def.Phase.PlaySetup; - isTrialMode = Guide.IsTrialMode; + isTrialMode = TrialMode.IsTrialModeEnabled(); phaseTime = 0; missionToStart2 = -1; decor.StopSound(); diff --git a/MarketPlace.cs b/MarketPlace.cs new file mode 100644 index 0000000..bdf362e --- /dev/null +++ b/MarketPlace.cs @@ -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."); + } + } +} diff --git a/AssemblyInfo.cs b/Properties/AssemblyInfo.cs similarity index 91% rename from AssemblyInfo.cs rename to Properties/AssemblyInfo.cs index 880cfa2..7b1a1af 100644 --- a/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -6,8 +6,8 @@ using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Speedy Blupi")] -[assembly: AssemblyProduct("Speedy Blupi")] +//[assembly: AssemblyTitle("Speedy Blupi")] +//[assembly: AssemblyProduct("Speedy Blupi")] [assembly: AssemblyDescription("")] [assembly: AssemblyCompany("Dada Games")] [assembly: AssemblyCopyright("Copyright © 2013")] @@ -16,7 +16,7 @@ using System.Resources; [assembly: NeutralResourcesLanguage("en-US")] // Configuration -[assembly: AssemblyConfiguration("")] +//[assembly: AssemblyConfiguration("")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] diff --git a/Speedy Blupi.csproj b/Speedy Blupi.csproj index 530a5c5..b710b01 100644 --- a/Speedy Blupi.csproj +++ b/Speedy Blupi.csproj @@ -10,6 +10,10 @@ app.manifest icon.ico + + false + + diff --git a/TrialMode.cs b/TrialMode.cs new file mode 100644 index 0000000..b423f70 --- /dev/null +++ b/TrialMode.cs @@ -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; + } + + + } + +} \ No newline at end of file