Example #1
0
        public void initialize(LunchHourGames lhg, int hexSize, int width, int height,
                               int xOffset, int yOffset, int penWidth, bool isPointy, Color backgroundColor)
        {
            this.hexSize         = hexSize;
            this.hexBoardWidth   = width;
            this.hexBoardHeight  = height;
            this.xOffset         = xOffset;
            this.yOffset         = yOffset;
            this.penWidth        = penWidth;
            this.backgroundColor = backgroundColor;

            if (isPointy)
            {
                this.orientation = HexOrientation.Pointy;
            }
            else
            {
                this.orientation = HexOrientation.Flat;
            }

            // Create the board.  Add all these
            createHexagonalBoard();
            this.extents = get3DExtents();

            // Go ahead and draw the hex board to the grid
            this.hexDraw.Draw(grid);
        }
Example #2
0
 public Ammo(LunchHourGames lhg, String referenceName, String displayName, Weapon weapon)
     : base(lhg, InventoryType.Ammo, referenceName, displayName)
 {
     this.weapon    = weapon;
     this.isMoving  = false;
     this.hitTarget = false;
 }
 public CombatScreen2D(LunchHourGames lhg, CombatSystem combatSystem)
     : base(lhg, Type.Combat)
 {
     this.combatSystem = combatSystem;
     this.lhg          = lhg;
     //this.hud = new CombatHUD(lhg, combatSystem);
 }
 protected CombatAction(LunchHourGames lhg, CombatSystem combatSystem, Handler combatActionHandler, ActionType actionType)
 {
     this.lhg                 = lhg;
     this.combatSystem        = combatSystem;
     this.combatActionHandler = combatActionHandler;
     this.actionType          = actionType;
 }
Example #5
0
 public PlayerAnimation(LunchHourGames lhg, Type type, Mode mode, AnimatedSprite sprite)
 {
     this.lhg    = lhg;
     this.type   = type;
     this.mode   = mode;
     this.sprite = sprite;
 }
Example #6
0
 public DrawCircle(LunchHourGames lhg, int vertexCount)
     : base(lhg)
 {
     device           = lhg.GraphicsDevice;
     this.vertexCount = vertexCount;
     worldMatrix      = Matrix.Identity;
 }
Example #7
0
        public SimpleSprite3D(LunchHourGames lhg)
            : base(lhg)
        {
            this.lhg = lhg;

            vertices = new VertexPositionNormalTexture[4];
            indexes  = new short[6];

            quadEffect = new BasicEffect(lhg.GraphicsDevice);
            quadEffect.LightingEnabled = false;

            /*
             * quadEffect.LightingEnabled = true; // turn on the lighting subsystem.
             * quadEffect.DirectionalLight0.DiffuseColor = new Vector3(0.5f, 0, 0); // a red light
             * quadEffect.DirectionalLight0.Direction = new Vector3(865, 128, 470);
             * quadEffect.DirectionalLight0.SpecularColor = new Vector3(0, 1, 0);
             * quadEffect.DirectionalLight0.Enabled = true;
             *
             * //quadEffect.AmbientLightColor = new Vector3(0.2f, 0.2f, 0.2f);
             * //quadEffect.EmissiveColor = new Vector3(0.2f, 0.2f, 0.2f);
             */

            this.world       = Matrix.Identity;
            quadEffect.World = Matrix.Identity;
        }
Example #8
0
 public PopupDrawer(LunchHourGames lhg, string referenceName, string displayName, Vector2 position,
                    Texture2D background, List <BasicControl> childControls)
     : base(lhg, referenceName, displayName, position)
 {
     this.background = background;
     currentState    = State.Closed;
     stateStartTime  = 0;
 }
Example #9
0
 public StartScreen(LunchHourGames lhg)
     : base(lhg, Type.Start)
 {
     LoadContent();
     TransitionPosition = 0;
     TransitionOnTime   = TimeSpan.Zero;
     TransitionOffTime  = new TimeSpan(0, 0, 2); // Allow 2 seconds for fade
 }
Example #10
0
        public SimpleSprite3D(LunchHourGames lhg, Texture2D texture)
            : this(lhg)
        {
            MyTexture = texture;

            width  = texture.Width;
            height = texture.Height;
        }
 public CombatFactory(LunchHourGames lhg, LoadingProgress progress, PlayerFactory playerFactory,
                      ObstacleFactory obstacleFactory, StageFactory stageFactory, InventoryFactory inventoryFactory)
 {
     this.lhg              = lhg;
     this.progress         = progress;
     this.playerFactory    = playerFactory;
     this.obstacleFactory  = obstacleFactory;
     this.stageFactory     = stageFactory;
     this.inventoryFactory = inventoryFactory;
 }
Example #12
0
 public CombatHUDPanel(LunchHourGames lhg, Player player)
     : base(lhg)
 {
     this.lhg          = lhg;
     this.spriteBatch  = lhg.MySpriteBatch;
     this.player       = player;
     this.playerSprite = player.MyHUDSprite;
     this.playerName   = player.MyName;
     this.font         = lhg.SmallFont;
 }
 public MessageBalloon(LunchHourGames lhg, String message, SpriteFont font, Effect effect, int maxTimeToShow)
     : base(lhg)
 {
     this.lhg           = lhg;
     this.message       = message;
     this.font          = font;
     this.effect        = effect;
     this.maxTimeToShow = maxTimeToShow;
     this.position      = new Vector2(1024 / 2, 350);
 }
Example #14
0
        public LogoScreen(LunchHourGames lhg)
            : base(lhg, Type.Logo)
        {
            LoadContent();
            position = new Vector2(0, Game.Window.ClientBounds.Height);

            TransitionPosition = 1;
            TransitionOnTime   = TimeSpan.Zero;
            TransitionOffTime  = new TimeSpan(0, 0, 2); // Allow 2 seconds for fade
        }
Example #15
0
 public PopupDrawer(LunchHourGames lhg, string referenceName, string displayName, Rectangle extents, List <BasicControl> childControls)
     : base(lhg, referenceName, displayName, new Vector2(extents.X, extents.Y))
 {
     background = new Texture2D(lhg.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
     background.SetData <Color>(new Color[1] {
         new Color(0, 0, 0, 125)
     });
     currentState   = State.Closed;
     stateStartTime = 0;
 }
Example #16
0
 public ButtonMenu(LunchHourGames lhg, SpriteFont spriteFont, Texture2D buttonImage, int spacer, ButtonMenuEvent eventHandler)
     : base(lhg)
 {
     this.spriteBatch  = lhg.MySpriteBatch;
     this.spriteFont   = spriteFont;
     this.buttonImage  = buttonImage;
     this.spacer       = spacer;
     this.eventHandler = eventHandler;
     this.width        = buttonImage.Width;
 }
        public AnimatedSprite3D(LunchHourGames lhg, SpriteSheet spriteSheet)
            : base(lhg)
        {
            this.spriteSheet = spriteSheet;
            direction        = AnimationKey.South;
            isAnimating      = false;
            FramesPerSecond  = 5;

            MyTexture = this.spriteSheet.getTexture(direction, 0);
        }
 public AnimatedSprite(LunchHourGames lhg, Texture2D texture, List <Animation> animations, SpriteBatch spriteBatch)
     : base(lhg, texture)
 {
     this.spriteBatch = spriteBatch;
     this.animations  = animations;
     currentAnimation = AnimationKey.North;
     isAnimating      = false;
     width            = animations[(int)currentAnimation].FrameWidth;
     height           = animations[(int)currentAnimation].FrameHeight;
     center           = new Vector2(width / 2, height / 2);
 }
Example #19
0
 public StagePanel(LunchHourGames lhg, LHGStage.StageSection section, LHGStage.StageLocation location,
                   int cellSize, int widthInCells, int heightInCells)
     : base(lhg)
 {
     this.section       = section;
     this.location      = location;
     this.cellSize      = cellSize;
     this.widthInCells  = widthInCells;
     this.heightInCells = heightInCells;
     this.extents       = Rectangle3D.Zero;
 }
Example #20
0
 public PushButton(LunchHourGames lhg, string referenceName, string displayName, State initState, Vector2 position,
                   Texture2D pressedTexture, Texture2D releasedTexture, Texture2D hoverTexture,
                   Tooltip toolTip, EventHandler eventHandler)
     : base(lhg, referenceName, displayName, position)
 {
     this.currentState    = initState;
     this.releasedTexture = releasedTexture;
     this.pressedTexture  = pressedTexture;
     this.toolTip         = toolTip;
     this.eventHandler    = eventHandler;
 }
Example #21
0
 public GameScreen(LunchHourGames lhg, Type type)
     : base(lhg)
 {
     this.lhg        = lhg;
     this.type       = type;
     playState       = PlayState.Intialized;
     spriteBatch     = lhg.MySpriteBatch;
     Content         = lhg.Content;
     childComponents = new List <GameComponent>();
     Visible         = false;
     Enabled         = false;
 }
Example #22
0
        public GameScreen3D(LunchHourGames lhg, GameScreen.Type type, LHGCamera camera)
            : base(lhg, type)
        {
            this.camera = camera;

            //Calculate the projection properties
            float aspectRatio = (float)lhg.GraphicsDevice.Viewport.Width / (float)lhg.GraphicsDevice.Viewport.Height;
            float fov         = MathHelper.PiOver4 * aspectRatio * 3 / 4;

            projection = Matrix.CreatePerspectiveFieldOfView(fov, aspectRatio, .1f, 10000f);
            world      = Matrix.Identity;
        }
Example #23
0
 public NumberBox(LunchHourGames lhg, String attributeName, int value, Vector2 position, int min, int max, SpriteFont font,
                  Texture2D background, Rectangle upButton, Rectangle downButton)
     : base(lhg, background, position, lhg.MySpriteBatch)
 {
     this.attributeName = attributeName;
     this.value         = value;
     this.min           = min;
     this.max           = max;
     this.font          = font;
     this.upButton      = upButton;
     this.downButton    = downButton;
 }
Example #24
0
        public CombatBoard(LunchHourGames lhg, int hexSize, int width, int height,
                           int xOffset, int yOffset, int penWidth, bool isPointy, Color backgroundColor)
            : base(lhg)
        {
            this.lhg = lhg;
            this.gridNumbersVisible = false;

            this.grid = new LHGGrid(lhg);
            grid.LoadGraphicsContent(lhg.GraphicsDevice);

            initialize(lhg, hexSize, width, height, xOffset, yOffset, penWidth, isPointy, backgroundColor);
        }
Example #25
0
        public SimpleSprite3D(LunchHourGames lhg, Texture2D texture, Rectangle3D extents)
            : this(lhg, texture)
        {
            upperLeft  = extents.topLeft;
            upperRight = extents.topRight;
            lowerLeft  = extents.bottomLeft;
            lowerRight = extents.bottomRight;

            origin = upperLeft;
            normal = upperLeft;

            FillVertices();
        }
Example #26
0
        public RatingScreen(LunchHourGames lhg)
            : base(lhg, Type.PlayerRating)
        {
            this.stats       = new PrimaryStatistics();
            this.numberBoxes = new List <NumberBox>();

            mouseStatePrevious = Mouse.GetState();
            LoadContent();

            TransitionPosition = 0;
            TransitionOnTime   = TimeSpan.Zero;
            TransitionOffTime  = new TimeSpan(0, 0, 2); // Allow 2 seconds for fade
        }
Example #27
0
        private static Random random = new Random();  // Random number generator to make the dice appear more random

        public CombatTurnBased(LunchHourGames lhg, CombatSystem combatSystem)
        {
            this.lhg          = lhg;
            this.combatSystem = combatSystem;

            this.chooseAction  = new ChooseAction(lhg, combatSystem, this);
            this.moveAction    = new MoveAction(lhg, combatSystem, this);
            this.attackAction  = new AttackAction(lhg, combatSystem, this);
            this.useAction     = new UseAction(lhg, combatSystem, this);
            this.defendAction  = new DefendAction(lhg, combatSystem, this);
            this.endTurnAction = new EndTurnAction(lhg, combatSystem, this);

            currentAction = null;
            nextAction    = null;
        }
Example #28
0
        public SimpleSprite(LunchHourGames lhg, Texture2D texture, Rectangle sourceRectangle)
            : base(lhg)
        {
            this.lhg             = lhg;
            this.texture         = texture;
            this.sourceRectangle = sourceRectangle;

            position = Vector2.Zero;
            velocity = Vector2.Zero;
            center   = new Vector2(sourceRectangle.Width / 2, sourceRectangle.Height / 2);
            width    = sourceRectangle.Width;
            height   = sourceRectangle.Height;
            scale    = 1.0f;
            rotation = 0.0f;
        }
Example #29
0
 public Weapon(LunchHourGames lhg, String referenceName, String displayName,
               AttackType attackType, Trajectory trajectory, bool usesAmmo,
               int range, int damage, int areaOfEffect, int actionPointCost)
     : base(lhg, InventoryType.Weapon, referenceName, displayName)
 {
     this.name            = name;
     this.attackType      = attackType;
     this.trajectory      = trajectory;
     this.usesAmmo        = usesAmmo;
     this.range           = range;
     this.damage          = damage;
     this.areaOfEffect    = areaOfEffect;
     this.actionPointCost = actionPointCost;
     this.isFiring        = false;
 }
Example #30
0
        public Player(LunchHourGames lhg, String templateName, String displayName, Player.Type type, bool isComputerControlled, PlayerSprite sprite)
            : base(lhg, EntityType.Player, templateName, displayName)
        {
            this.templateName         = templateName;
            this.type                 = type;
            this.isComputerControlled = isComputerControlled;
            this.isActive             = true;
            this.sprite               = sprite;
            this.roll                 = -1; // indicate that a roll has not taken place
            this.walkingSpeed         = 1.0f;

            this.idNumber    = random.Next(10, 1000);
            this.isIdVisible = false;

            this.attributes = new DerivedAttributes();
        }