Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using SnakeProject;
- using System.Drawing;
- namespace ProjektArbete_Lundahl_Löfvenhaft
- {
- [Serializable]
- class Cake : BallSnakeFood
- {
- /// <summary>
- /// konstruktor utan argument
- /// </summary>
- public Cake() : base(21, 15)
- {
- }
- /// <summary>
- /// konstruktor för att skapa kakan.
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- /// <param name="color"></param>
- /// <param name="size"></param>
- float storlek;
- bool harRussin;
- public Cake(int x, int y, Color color, float size, bool russin) : base(x, y)
- {
- BGColor = color;
- storlek = size;
- harRussin = russin;
- }
- public override void Draw(Graphics g)
- {
- base.Draw(g);
- g.FillEllipse(new SolidBrush(BGColor), (int)Pos.X - (storlek/2), (int)Pos.Y - (storlek/2), storlek, storlek);
- if(harRussin == true)
- g.FillEllipse(new SolidBrush(Color.Black), (int)Pos.X - (storlek / 4),
- (int)Pos.Y - (storlek / 4), storlek / 2, storlek / 2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement