Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- /// <summary>
- /// Opdracht ge maakt door Jessey N
- /// </summary>
- namespace GameEngine
- {
- /// <summary>
- /// Opdracht ge maakt door Jessey N
- /// </summary>
- public class Les2 : AbstractGame
- {
- public Bitmap mario, dog;
- public override void GameStart()
- {
- //Everything that has to happen when the game starts happens here.
- //F.e. initializing objects.
- }
- public override void GameEnd()
- {
- //Clean up unmanaged objects here (F.e. bitmaps & fonts)
- //For example:
- //m_Bitmap.Dispose();
- //m_Font.Dispose();
- try
- {
- mario.Dispose();
- dog.Dispose();
- } catch(Exception ex)
- {
- Console.WriteLine(ex);
- }
- }
- public override void Update()
- {
- //Update everything here.
- //F.e. get input, move objects, etc...
- //For example:
- //float deltaTime = GAME_ENGINE.GetDeltaTime();
- //bool isDown = GAME_ENGINE.GetKeyDown(Key.Right);
- bool isEsc = GAME_ENGINE.GetKeyDown(Key.Escape);
- if (isEsc)
- {
- this.GameEnd();
- System.Windows.Forms.Application.Exit();
- }
- }
- public override void Paint()
- {
- //Draw everything here.
- //For example:
- //GAME_ENGINE.DrawRectangle(10, 10, 150, 25);
- //GAME_ENGINE.FillEllipse(50, 75, 50, 50);
- GAME_ENGINE.SetColor(0, 0, 0);
- GAME_ENGINE.DrawString("1.", 5, 20, 250, 50);
- GAME_ENGINE.DrawString("Jessey Dennis Novani", 20, 20, 250, 50);
- GAME_ENGINE.DrawString("2.", 7, 20 + 50, 250, 50);
- GAME_ENGINE.DrawLine(25, 20 + 50 + 40, 25 + (50 / 2), 55); //links
- GAME_ENGINE.DrawLine(25 + 50, 20 + 50 + 40, 25 + (50 / 2), 55); //rechts
- GAME_ENGINE.DrawRectangle(25, 20 + 50 + 40, 50, 50); //base
- GAME_ENGINE.DrawString("3.", 7, 20 + 50 + 100, 250, 50);
- GAME_ENGINE.SetColor(255, 255, 255);
- GAME_ENGINE.FillRectangle(25, 20 + 50 + 100, 150, 90); //flag
- GAME_ENGINE.SetColor(255, 0, 0);
- GAME_ENGINE.FillEllipse(25 + (150 / 2), 20 + 50 + 100 + (90 / 2), 25, 25); //punt
- GAME_ENGINE.SetColor(0, 0, 0);
- GAME_ENGINE.DrawString("4.", 7, 20 + 50 + 220, 250, 50);
- GAME_ENGINE.FillRectangle(25, 20 + 50 + 220, 150, 150); // background
- GAME_ENGINE.SetColor(Color.White);
- GAME_ENGINE.FillRectangle(25 + 50, 20 + 50 + 220, 50, 150);
- GAME_ENGINE.FillRectangle(25, 20 + 50 + 220 + 50, 150, 50);
- GAME_ENGINE.SetColor(Color.Black);
- GAME_ENGINE.DrawRectangle(25, 20 + 50 + 220, 150, 150); // side
- GAME_ENGINE.FillRectangle(25 + 50, 20 + 50 + 220 + 50, 50, 50); // middel block
- GAME_ENGINE.DrawString("5.", 213 - 7, 20, 250, 50);
- GAME_ENGINE.SetColor(Color.Gray);
- GAME_ENGINE.FillRectangle(213 + 7, 20, 40, 120);
- GAME_ENGINE.FillRectangle(213 + 7 + 15, 20 + 120, 10, 50);
- GAME_ENGINE.SetColor(Color.Red);
- GAME_ENGINE.FillEllipse(213 + 7 + 20, 20 + 20, 15, 15);
- GAME_ENGINE.SetColor(255, 165, 0);
- GAME_ENGINE.FillEllipse(213 + 7 + 20, 20 + 20 + 40, 15, 15);
- GAME_ENGINE.SetColor(Color.Green);
- GAME_ENGINE.FillEllipse(213 + 7 + 20, 20 + 20 + 40 + 40, 15, 15);
- GAME_ENGINE.SetColor(0, 0, 0);
- GAME_ENGINE.DrawString("6.", 213 - 7, 20 + 200, 250, 50);
- GAME_ENGINE.DrawRoundedRectangle(213 + 7, 20 + 200, 150, 150, 5, 5);
- GAME_ENGINE.SetColor(Color.White);
- GAME_ENGINE.FillRoundedRectangle(213 + 7, 20 + 200, 150, 150, 5, 5);
- GAME_ENGINE.SetColor(Color.Black);
- GAME_ENGINE.FillEllipse(213 + 7 + 75, 20 + 200 + 75, 15, 15);
- GAME_ENGINE.FillEllipse(213 + 7 + 25, 20 + 200 + 25, 15, 15);
- GAME_ENGINE.FillEllipse(213 + 7 + 125, 20 + 200 + 125, 15, 15);
- GAME_ENGINE.DrawString("7. Mario", 426 - 7, 20, 250, 50);
- Bitmap mario = new Bitmap("mario.bmp");
- GAME_ENGINE.DrawBitmap(mario, 426, 20);
- GAME_ENGINE.DrawString("8. Nes dude", 426 - 7, 20 + 220, 250, 50);
- Bitmap dog = new Bitmap("dog.bmp");
- GAME_ENGINE.DrawBitmap(dog, 426, 20 + 220);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement