Skip to content

Commit

Permalink
logo broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Perdue committed Mar 10, 2022
1 parent 019ad89 commit 46bb698
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
Binary file added Assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions Characters/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class Player : Character
private Boolean paused = false;
private Panel pausePanel;
public Label scoreLabel;
//public Timer cooldown;
public Player()
{
playerModelPath = "Assets/TestModel.png";
Expand All @@ -48,7 +49,7 @@ public Player()
Scale = new Vector2(1, 1)
};
AddComponent(sprite);
attackCooldown = new Timer(0.5f);
attackCooldown = new Timer(0.1f);
attackCooldown.OnTick += cooldown;
attackCooldown.Loop = true;
speed = 110;
Expand Down Expand Up @@ -181,7 +182,7 @@ private void handlePrimaryAttack(MouseState mouseState)
Scale = new Vector2(1, 1),
Rotation = sprite.Rotation
});
weapon.Attack(false,true);
weapon.Attack(false, true);
}

if (mouseState.LeftButton == ButtonState.Released)
Expand All @@ -194,6 +195,7 @@ private void handlePrimaryAttack(MouseState mouseState)
Rotation = sprite.Rotation
});
}
canAttack = false;
}

private int rightButtonHeld = 0;
Expand Down Expand Up @@ -283,12 +285,12 @@ public override void Update(GameTime delta)
base.Update(delta);
if (!paused)
{
attackCooldown.Update(delta);
var time = (float)(delta.ElapsedGameTime.TotalSeconds);
var movement = InputHandler.GetEvent("Movement");
var mouseState = Mouse.GetState();
Vector2 mousePos = Scene.ToGridLocation(mouseState.Position);
Vector2 deltaPos = new Vector2((mousePos.X - Position.X), -(mousePos.Y - Position.Y));

float angleA = sprite.Rotation;
if (deltaPos.Y >= 0)
{
Expand Down
1 change: 0 additions & 1 deletion Entities/Weapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ public virtual bool Attack(bool lungeAttack,bool player)
{
if (Math.Abs(enemy.Position.X - character.Position.X) < 40 && Math.Abs(enemy.Position.Y - character.Position.Y) < 40)
{
DiagnosticsHook.DebugMessage("a");
enemy.onDamage(damage * character.damage, character.attackDirection, (int)(knockback * 1.5));
isAttacking = false;
}
Expand Down
9 changes: 9 additions & 0 deletions Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
using tileEngine.SDK.GUI;
using tileEngine.SDK.GUI.Elements;
using CampusCrawl.Entities.Weapons;
using Microsoft.Xna.Framework.Graphics;

namespace CampusCrawl
{
public class Game : TileEngineGame
{
private Player mainPlayer;
private RectangleButton startButton;
private Picture guiImage;
public void startGame(Point location)
{
UI.RemoveElement(startButton);
UI.RemoveElement(guiImage);
mainPlayer = new Player();
var entity = new Entities.Entity("Assets/TestModel.png");
TileEngine.Instance.SetScene(typeof(AlexandraSquare));
Expand All @@ -39,6 +42,12 @@ public override void Initialize()
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");
Texture2D logo = AssetManager.AttemptLoad<Texture2D>("logo.png");
guiImage = new Picture();
guiImage.Texture = logo;
guiImage.Anchor = UIAnchor.Top;
// guiImage.Offset = new Vector2(0, -70);
UI.AddElement(guiImage);
startButton = new RectangleButton();
startButton.OnClick += startGame;
startButton.Anchor = UIAnchor.Center;
Expand Down
Binary file modified campus-crawl.teproj
Binary file not shown.

0 comments on commit 46bb698

Please sign in to comment.