Skip to content

Commit

Permalink
Merge branch 'release/0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcAssey committed Mar 6, 2014
2 parents a2b27f6 + 0a595a6 commit caee60d
Show file tree
Hide file tree
Showing 188 changed files with 1,146 additions and 291 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ SolarFusion/SolarFusion/SolarFusionContent/obj/
SolarFusion/SolarFusion/SolarFusion/bin/
SolarFusion/GameData/obj/
SolarFusion/DataPipeline/obj/
SolarFusion/DataPipeline/bin/
SolarFusion/GameData/bin/x86/Debug/GameData.dll
2 changes: 0 additions & 2 deletions SolarFusion/GameData/LevelData/LevelTilemapData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@ public struct LevelTilemapData
public float ScrollSpeed;
public float LayerDepth;
public LevelTileData[] TileData;


}
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private void WIN32_ReadFile()
}
}
}
catch (InvalidOperationException ex01) // Error reading and deserializing the file, so creates a new one.
catch (InvalidOperationException ex) // Error reading and deserializing the file, so creates a new one.
{
if (_stream != null)
_stream.Close(); // Closes the stream if it exists.
Expand Down
2 changes: 1 addition & 1 deletion SolarFusion/SolarFusion/SolarFusion/Core/Entities/AI/AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override void Update(GameTime gameTime)

public override void Draw(SpriteBatch spriteBatch)
{
animation.Draw(spriteBatch);
animation.Draw(spriteBatch, 1f);
}

public void moveLeft()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Enemy_MercBot(uint id, ContentManager virtualContent, Vector2 position)
this.animation.Scale = 1.5f;
this.animation.CurrentAnimation = "idle";
this.animation.Loop = true;
//MERCBOT

this.Health = 100;
this.Speed = 1f;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private void RemoveGameObject(GameObjects gameObject)
{
box = boundingBoxes[id];
}
catch (KeyNotFoundException e)
catch (KeyNotFoundException ex)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public override void Draw(SpriteBatch spriteBatch)
{
if (isHidden == false)
{
playerAnimation.Draw(spriteBatch);
playerAnimation.Draw(spriteBatch, 1f);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override void Update(GameTime gameTime)
}
public override void Draw(SpriteBatch spriteBatch)
{
animation.Draw(spriteBatch);
animation.Draw(spriteBatch, 1f);
}
}
}
10 changes: 8 additions & 2 deletions SolarFusion/SolarFusion/SolarFusion/Core/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ public class Game : Microsoft.Xna.Framework.Game
public Game()
{
this._obj_config = new ConfigManager();

this.Window.Title = SysConfig.CONFIG_GAME_NAME;
this.Content.RootDirectory = SysConfig.CONFIG_CONTENT_ROOT;

try
{
this._obj_graphics = new GraphicsDeviceManager(this);
}
catch (Exception ex)
{
Environment.Exit(0);
}

try
{
this._obj_graphics.PreferredBackBufferWidth = this._obj_config.Settings.VIDEO_RES_WIDTH;
this._obj_graphics.PreferredBackBufferHeight = this._obj_config.Settings.VIDEO_RES_HEIGHT;
this._obj_graphics.IsFullScreen = this._obj_config.Settings.VIDEO_FULLSCREEN;
Expand All @@ -54,7 +61,6 @@ public Game()
this._obj_config.Settings.VIDEO_VSYNC = true;
this._obj_config.Settings.VIDEO_DEPTH_STENCIL_BUFFER = (int)DepthFormat.Depth24Stencil8;
#endif
this._obj_graphics = new GraphicsDeviceManager(this);
this._obj_graphics.PreferredBackBufferWidth = this._obj_config.Settings.VIDEO_RES_WIDTH;
this._obj_graphics.PreferredBackBufferHeight = this._obj_config.Settings.VIDEO_RES_HEIGHT;
this._obj_graphics.IsFullScreen = this._obj_config.Settings.VIDEO_FULLSCREEN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public InputManager()
this.AddGamePadInput("NAV_CANCEL", SysConfig.INPUT_GAMEPAD_CANCEL, true);

this.AddGamePadInput("GLOBAL_START", SysConfig.INPUT_GAMEPAD_START, false);
this.AddGamePadInput("GAME_PAUSE", SysConfig.INPUT_GAMEPAD_START, false);

this.AddGamePadInput("PLAY_MOVE_LEFT", SysConfig.INPUT_GAMEPAD_LEFT_DPAD, false);
this.AddGamePadInput("PLAY_MOVE_LEFT", SysConfig.INPUT_GAMEPAD_LEFT_STICK, false);
Expand All @@ -48,6 +49,7 @@ public InputManager()
this.AddKeyboardInput("NAV_CANCEL", SysConfig.INPUT_KEYBOARD_CANCEL, true);

this.AddKeyboardInput("GLOBAL_START", SysConfig.INPUT_KEYBOARD_START, false);
this.AddKeyboardInput("GAME_PAUSE", SysConfig.INPUT_KEYBOARD_CANCEL, false);

this.AddKeyboardInput("PLAY_MOVE_LEFT", SysConfig.INPUT_KEYBOARD_LEFT, false);
this.AddKeyboardInput("PLAY_MOVE_RIGHT", SysConfig.INPUT_KEYBOARD_RIGHT, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ScreenMsgBox(string ptexture, string pmessage)
/// </summary>
public override void loadContent()
{
this._message_bg = this.GlobalContentManager.Load<Texture2D>(this._message_bg_file);
this._message_bg = this.GlobalContentManager.Load<Texture2D>("Sprites/Misc/UI/Buttons/misc/blue_panel");
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,39 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SolarFusion.Core.Screen
{
class ScreenPause : BaseGUIScreen
{
//----------------CLASS CONSTANTS---------------------------------------------------------
public const float DEFAULT_ALPHA = 2.0f / 3.0f;
public const int DEFAULT_PADDING_H = 32;
public const int DEFAULT_PADDING_V = 16;
public static readonly Color DEFAULT_COLOUR = Color.White;

//----------------CLASS MEMBERS-----------------------------------------------------------
protected float _message_alpha;

//-----------------CONSTRUCTOR----------------------------------------------------------------

/// <summary>
/// Constructor.
/// </summary>
public ScreenPause()
: base("- PAUSED -", false, null)
: base("- PAUSED -", false, null, false, 1f)
{
this._message_alpha = DEFAULT_ALPHA;
}

public override void loadContent()
{
// Create our menu entries.
MenuItemBasic tentryresume = new MenuItemBasic("Resume");
MenuItemBasic tentryquit = new MenuItemBasic("Exit");
MenuItemBasic tentryresume = new MenuItemBasic("RESUME", this.GlobalContentManager);
MenuItemBasic tentryquit = new MenuItemBasic("EXIT", this.GlobalContentManager);

// Hook up menu event handlers.
tentryresume.OnSelected += DefaultTriggerMenuBack;
Expand All @@ -26,6 +43,15 @@ public ScreenPause()
// Add entries to the menu.
this._list_menuitems.Add(tentryresume);
this._list_menuitems.Add(tentryquit);

this.BGColour = Color.Black;
base.loadContent();
}

public override void render()
{
this.ScreenManager.fadeBackBuffer(this.CurrentTransitionAlpha * this._message_alpha);
base.render();
}

//-----------------EVENT HANDLER DELEGATES---------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SolarFusion.Core.Screen
{
class ScreenCredits : BaseGUIScreen
{
public ScreenCredits()
: base("CREDITS", false, null)
: base("CREDITS", Color.White, true, "System/UI/Logos/static_dimensionalwave", true, 1f)
{

}

public override void loadContent()
{
base.loadContent();
//load credits
}

public override void update()
{
if(this.GlobalInput.IsPressed("NAV_CANCEL", this.ControllingPlayer)) //If player presses cancel button (Escape/B)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ namespace SolarFusion.Core.Screen
{
class ScreenMenuRoot : BaseGUIScreen
{
List<AnimatedBGEntity> mAnimatedBGObjects = null;
ContentManager _content = null;
Random _obj_random = null;

public ScreenMenuRoot()
: base("Root_Menu", true, "System/UI/Logos/static_jumpista")
: base("Root_Menu", true, "System/UI/Logos/static_jumpista", true, 0.5f)
{
_obj_random = new Random();
}

MenuItemBasic mi_play = new MenuItemBasic("Play");
MenuItemBasic mi_options = new MenuItemBasic("Options");
MenuItemBasic mi_credits = new MenuItemBasic("Credits");
MenuItemBasic mi_exit = new MenuItemBasic("Exit");
public override void loadContent()
{
MenuItemBasic mi_play = new MenuItemBasic("PLAY", this.GlobalContentManager);
MenuItemBasic mi_options = new MenuItemBasic("OPTIONS", this.GlobalContentManager);
MenuItemBasic mi_credits = new MenuItemBasic("CREDITS", this.GlobalContentManager);
MenuItemBasic mi_exit = new MenuItemBasic("EXIT", this.GlobalContentManager);

mi_play.OnSelected += EventTriggerGoToCharSelect;
mi_options.OnSelected += EventTriggerGoToOptions;
Expand All @@ -35,131 +33,17 @@ public ScreenMenuRoot()
this._list_menuitems.Add(mi_options);
this._list_menuitems.Add(mi_credits);
this._list_menuitems.Add(mi_exit);
}

public override void loadContent()
{
if (this._content == null)
this._content = new ContentManager(ScreenManager.Game.Services, SysConfig.CONFIG_CONTENT_ROOT);

this.mAnimatedBGObjects = new List<AnimatedBGEntity>();

bool IsSelectedUnique = false;

for (int i = 0; i < 20; i++)
{
int randItem = this._obj_random.Next(0, 2);

int randDirX = this._obj_random.Next(0, 2); // 0 = Left to Right, 1 = Right to Left
float randPosX = 0f;
float randPosY = 0f;
int randRotDir = this._obj_random.Next(0, 2); // 0 = Left to Right, 1 = Right to Left
float randRotSpeed = (float)((this._obj_random.NextDouble() * Math.Abs(0.04 - 0.01)) + 0.01); // Generate random rotation speed between 0.01 and 0.06 every frame.

if(randDirX == 0)
randPosX = (float)(this._obj_random.Next(-300, ScreenManager.GraphicsDevice.Viewport.Width) - ScreenManager.GraphicsDevice.Viewport.Width);
else
randPosX = (float)(this._obj_random.Next(0, ScreenManager.GraphicsDevice.Viewport.Width) + ScreenManager.GraphicsDevice.Viewport.Width);

randPosY = (float)this._obj_random.Next(0, ScreenManager.GraphicsDevice.Viewport.Height);

switch (randItem)
{
case 0: //Grandfather clock
this.mAnimatedBGObjects.Add(new AnimatedBGEntity(this._content.Load<Texture2D>("Sprites/Misc/Animated/anim_grandfather_clock"), 4, 1, (float)((this._obj_random.NextDouble() * 10) - 5), new Vector2(randPosX, randPosY), this._obj_random.Next(0, 4), 4, 1f, 1f, randDirX, 0, randRotDir, randRotSpeed));
break;
case 1: //Other items
this.mAnimatedBGObjects.Add(new AnimatedBGEntity(this._content.Load<Texture2D>("Sprites/Misc/Animated/anim_coin"), 9, 1, (float)((this._obj_random.NextDouble() * 10) - 5), new Vector2(randPosX, randPosY), this._obj_random.Next(0, 10), 20, 1f, 1f, randDirX, 0, randRotDir, randRotSpeed));
break;
}

if (IsSelectedUnique == false)
{
IsSelectedUnique = true;

int randItemUnique = this._obj_random.Next(0, 1);
int randDirXUnique = this._obj_random.Next(0, 2); // 0 = Left to Right, 1 = Right to Left
float randPosXUnique = 0f;
float randPosYUnique = 0f;
int randRotDirUnique = this._obj_random.Next(0, 2); // 0 = Left to Right, 1 = Right to Left
float randRotSpeedUnique = (float)((this._obj_random.NextDouble() * Math.Abs(0.04 - 0.01)) + 0.01); // Generate random rotation speed between 0.01 and 0.06 every frame.

if (randPosXUnique == 0)
randPosXUnique = (float)(this._obj_random.Next(-300, ScreenManager.GraphicsDevice.Viewport.Width) - ScreenManager.GraphicsDevice.Viewport.Width);
else
randPosXUnique = (float)(this._obj_random.Next(0, ScreenManager.GraphicsDevice.Viewport.Width) + ScreenManager.GraphicsDevice.Viewport.Width);

randPosYUnique = (float)this._obj_random.Next(0, ScreenManager.GraphicsDevice.Viewport.Height);

switch (randItemUnique)
{
case 0: //Megaman
this.mAnimatedBGObjects.Add(new AnimatedBGEntity(this._content.Load<Texture2D>("Sprites/Misc/Unique/anim_megaman"), 8, 1, (float)((_obj_random.NextDouble() * 10) - 5), new Vector2(randPosXUnique, randPosYUnique), _obj_random.Next(0, 9), 24, 1f, 1f, randDirXUnique, 0, randRotDirUnique, randRotSpeedUnique));
break;
}
}
}

base.loadContent();
}

public override void update()
{
if (this.mAnimatedBGObjects != null)
{
foreach (AnimatedBGEntity entity in this.mAnimatedBGObjects)
{
entity.Update(GlobalGameTimer);

if (entity.RotationDirection == 0)
entity.Animation.Rotation += entity.RotationSpeed; //Rotate Left to Right
else
entity.Animation.Rotation -= entity.RotationSpeed; //Rotate Right to Left

if (entity.DirectionX == 0) //Left to Right
{
if (entity.Animation.Position.X > ScreenManager.GraphicsDevice.Viewport.Width + (entity.Animation.AnimationWidth + entity.Animation.AnimationHeight))
{
entity.Animation.Position = new Vector2(entity.Animation.Position.X - (ScreenManager.GraphicsDevice.Viewport.Width + entity.Animation.AnimationWidth + entity.Animation.AnimationHeight + 100), entity.Animation.Position.Y);
}
else
{
entity.Animation.Position = new Vector2(entity.Animation.Position.X + entity.GetSpeedX, entity.Animation.Position.Y);
}
}
else //Right to Left
{
if (entity.Animation.Position.X < 0 - (entity.Animation.AnimationWidth + entity.Animation.AnimationHeight))
{
entity.Animation.Position = new Vector2(entity.Animation.Position.X + (ScreenManager.GraphicsDevice.Viewport.Width + entity.Animation.AnimationWidth + entity.Animation.AnimationHeight + 100), entity.Animation.Position.Y);
}
else
{
entity.Animation.Position = new Vector2(entity.Animation.Position.X - entity.GetSpeedX, entity.Animation.Position.Y);
}
}
}
}

base.update();
}

public override void render()
{
GraphicsDevice tgd = ScreenManager.GraphicsDevice;
SpriteBatch tsb = ScreenManager.SpriteBatch;
tsb.Begin();

if (mAnimatedBGObjects != null)
{
foreach (AnimatedBGEntity entity in mAnimatedBGObjects)
{
entity.Draw(tsb);
}
}

tsb.End();

base.render();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SolarFusion.Core.Screen
{
class ScreenOptions : BaseGUIScreen
{
public ScreenOptions()
: base("Options", false, null)
: base("OPTIONS", Color.White, false, null, true, 1f)
{

}
Expand Down
Loading

0 comments on commit caee60d

Please sign in to comment.