Exemple #1
0
        private void highlightSelectedStyle(StyleOfCreature style)
        {
            switch (style)
            {
            case StyleOfCreature.Pastel:
                pastelColourButton.BackColor    = Color.AliceBlue;
                gothColourButton.BackColor      = Color.White;
                referenceColourButton.BackColor = Color.White;
                break;

            case StyleOfCreature.Goth:
                gothColourButton.BackColor      = Color.AliceBlue;
                referenceColourButton.BackColor = Color.White;
                pastelColourButton.BackColor    = Color.White;
                break;

            case StyleOfCreature.Strange:
                referenceColourButton.BackColor = Color.AliceBlue;
                gothColourButton.BackColor      = Color.White;
                pastelColourButton.BackColor    = Color.White;
                break;

            default:
                break;
            }
        }
        public GameForm(StyleOfCreature style, string name, string pName)
        {
            InitializeComponent();

            this.graphicTimer.Tick += new System.EventHandler(this.Update);
            graphicTimer.Start();

            creature = new Creature(style);
            creature.SetStyle(style);
            creature.SetName(name);
            creatureNameBox.Text = creature.GetName();

            player = new Player(pName, 15);

            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
        }
 public void SetStyle(StyleOfCreature style)
 {
     StyleOfCreature = style;
 }
        public Creature(StyleOfCreature style)
        {
            StyleOfCreature = style;

            switch (StyleOfCreature)
            {
            case StyleOfCreature.Goth:
                IdleBitmap     = new Bitmap(@"Images\Goth-Idle.PNG");
                EatingBitmap   = new Bitmap(@"Images\Goth-Eating.PNG");
                TickeledBitmap = new Bitmap(@"Images\Goth-Tickle.PNG");
                PettingBitmap  = new Bitmap(@"Images\Goth-Pet.PNG");
                RefuseBitmap   = new Bitmap(@"Images\Goth-Refuse.PNG");

                HungryBitmap = new Bitmap(@"Images\Goth-Hungry-Idle.PNG");
                HappyBitmap  = new Bitmap(@"Images\Goth-Happy-Idle.PNG");
                LowHPBitmap  = new Bitmap(@"Images\Goth-Low-HP.PNG");
                SadBitmap    = new Bitmap(@"Images\Goth-Sad-Idle.PNG");
                AngryBitmap  = new Bitmap(@"Images\Goth-Angry-Idle.PNG");

                AttackBitmap = new Bitmap(@"Images\Goth-Attack.PNG");
                break;

            case StyleOfCreature.Pastel:
                IdleBitmap     = new Bitmap(@"Images\Pastel-Idle.PNG");
                EatingBitmap   = new Bitmap(@"Images\Pastel-Eating.PNG");
                TickeledBitmap = new Bitmap(@"Images\Pastel-Tickle.PNG");
                PettingBitmap  = new Bitmap(@"Images\Pastel-Pet.PNG");
                RefuseBitmap   = new Bitmap(@"Images\Pastel-Refuse.PNG");

                HungryBitmap = new Bitmap(@"Images\Pastel-Hungry-Idle.PNG");
                HappyBitmap  = new Bitmap(@"Images\Pastel-Happy-Idle.PNG");
                LowHPBitmap  = new Bitmap(@"Images\Pastel-Low-HP.PNG");
                SadBitmap    = new Bitmap(@"Images\Pastel-Sad-Idle.PNG");
                AngryBitmap  = new Bitmap(@"Images\Pastel-Angry-Idle.PNG");
                AttackBitmap = new Bitmap(@"Images\Pastel-Attack.PNG");
                break;

            case StyleOfCreature.Strange:
                IdleBitmap     = new Bitmap(@"Images\Strange-Idle.PNG");
                EatingBitmap   = new Bitmap(@"Images\Strange-Eating.PNG");
                TickeledBitmap = new Bitmap(@"Images\Strange-Tickle.PNG");
                PettingBitmap  = new Bitmap(@"Images\Strange-Pet.PNG");
                RefuseBitmap   = new Bitmap(@"Images\Strange-Refuse.PNG");

                HungryBitmap = new Bitmap(@"Images\Strange-Hungry-Idle.PNG");
                HappyBitmap  = new Bitmap(@"Images\Strange-Happy-Idle.PNG");
                LowHPBitmap  = new Bitmap(@"Images\Strange-Low-HP.PNG");
                SadBitmap    = new Bitmap(@"Images\Strange-Sad-Idle.PNG");
                AngryBitmap  = new Bitmap(@"Images\Strange-Angry-Idle.PNG");
                AttackBitmap = new Bitmap(@"Images\Strange-Attack.PNG");
                break;

            default:
                IdleBitmap     = new Bitmap(@"Images\Goth-Idle.PNG");
                EatingBitmap   = new Bitmap(@"Images\Goth-Eating.PNG");
                TickeledBitmap = new Bitmap(@"Images\Goth-Tickle.PNG");
                PettingBitmap  = new Bitmap(@"Images\Goth-Pet.PNG");
                RefuseBitmap   = new Bitmap(@"Images\Goth-Refuse.PNG");

                HungryBitmap = new Bitmap(@"Images\Goth-Hungry-Idle.PNG");
                HappyBitmap  = new Bitmap(@"Images\Goth-Happy-Idle.PNG");
                LowHPBitmap  = new Bitmap(@"Images\Goth-Low-HP.PNG");
                SadBitmap    = new Bitmap(@"Images\Goth-Sad-Idle.PNG");
                AngryBitmap  = new Bitmap(@"Images\Goth-Angry-Idle.PNG");
                AttackBitmap = new Bitmap(@"Images\Goth-Attack.PNG");
                break;
            }

            CurrentBackground = new Bitmap(@"Images\Background-Basic-Room.PNG");

            CurrentBitmap     = IdleBitmap;
            CurrentSpriteSize = new Size(110, 93); //width height single sprite

            BackgroundPosition = new Point(0, 0);
            BackgroundSize     = new Size(816, 489);

            BackgroundDestRect   = new Rectangle(BackgroundPosition, BackgroundSize);
            BackgroundSourceRect = new Rectangle(BackgroundPosition, BackgroundSize);

            AdjustedSpriteSize = new Size(CurrentSpriteSize.Width * spriteScale, CurrentSpriteSize.Height * spriteScale);

            SpritePosition      = new Point(0, 0);
            Position.X          = 200;
            Position.Y          = 150;
            CurrentSpriteNumber = 0;
            NumberOfSprites     = 3;

            SourceRect = new Rectangle(SpritePosition, CurrentSpriteSize);
            DestRect   = new Rectangle(Position, AdjustedSpriteSize);

            healthPoint = 5; //eventually health point will switch to 100 and they will be the players hp

            happinessLevel       = 5;
            hungerLevel          = 5;
            happinessIncrementer = 0;
            hungerIncrementer    = 0;
            healthDecrementer    = 0;

            sentienceLevel = 0;
            boredomLevel   = 0;

            temporaryAnimationLoop       = 0;
            temporaryAnimationLoopActive = false;


            CurrentAnimationState  = AnimationState.Idle;
            PreviousAnimationState = AnimationState.Idle;
        }
Exemple #5
0
 private void referenceColourButton_Click(object sender, EventArgs e)
 {
     selectedStyle = StyleOfCreature.Strange;
     highlightSelectedStyle(selectedStyle);
 }
Exemple #6
0
 private void pastelColourButton_Click(object sender, EventArgs e)
 {
     selectedStyle = StyleOfCreature.Pastel;
     highlightSelectedStyle(selectedStyle);
 }
Exemple #7
0
 private void gothColourButton_Click(object sender, EventArgs e)
 {
     selectedStyle = StyleOfCreature.Goth;
     highlightSelectedStyle(selectedStyle);
 }
Exemple #8
0
 public StartMenu()
 {
     selectedStyle = StyleOfCreature.None;
     InitializeComponent();
 }