Skip to content

Commit

Permalink
made basic start screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Perdue committed Mar 6, 2022
1 parent 43ba410 commit 30558fd
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,40 @@ namespace CampusCrawl
public class Game : TileEngineGame
{
private Player mainPlayer;
public override void Initialize()
private RectangleButton startButton;
public void startGame(Point location)
{
//Create movement bindings.
TileEngine.Instance.MouseInput.AddBinding(MouseInputType.Position, "MousePosition");
TileEngine.Instance.KeyboardInput.AddAxisBinding(Keys.D, Keys.A, Keys.S, Keys.W, "Movement");
UI.RemoveElement(startButton);
mainPlayer = new Player();
var entity = new Entities.Entity("Assets/TestModel.png");
TileEngine.Instance.SetScene(typeof(AlexandraSquare));
TileEngine.Instance.GetScene().AddObject(mainPlayer);
TileEngine.Instance.GetScene().AddObject(entity);
TileEngine.Instance.GetScene().CameraPosition = new Vector2(-320, -320);
mainPlayer.SetLayer("Objects");
UI.Initialize("Fonts/MakanHati-vmp94.ttf");
BaseScene scene = (BaseScene)TileEngine.Instance.GetScene();
mainPlayer.CreateAndSetWeapon(new Fists(mainPlayer));
}
public override void Initialize()
{
//Create movement bindings.
TileEngine.Instance.MouseInput.AddBinding(MouseInputType.Position, "MousePosition");
TileEngine.Instance.KeyboardInput.AddAxisBinding(Keys.D, Keys.A, Keys.S, Keys.W, "Movement");
UI.Initialize("Fonts/MakanHati-vmp94.ttf");
startButton = new RectangleButton();
startButton.OnClick += startGame;
startButton.Anchor = UIAnchor.Center;
startButton.BorderColour = Color.Black;
startButton.BackgroundColour = Color.Green;
Label label = new Label();
label.Text = "Start game";
label.FontSize = 32;
label.Colour = Color.Black;
startButton.Label = label;
UI.AddElement(startButton);
TileEngine.Instance.SetScene(typeof(Spar));
}


public override void Shutdown()
{
Expand Down

0 comments on commit 30558fd

Please sign in to comment.