mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-06-30 19:15:25 +08:00
Sample game. Easing methods. Colors.
This commit is contained in:
@ -77,8 +77,6 @@ namespace Strawberry
|
||||
let hit = First<Solid>(.(sign, 0));
|
||||
if (hit != null)
|
||||
{
|
||||
ZeroRemainderX();
|
||||
|
||||
let c = Collision(
|
||||
Point.Right * sign,
|
||||
Math.Abs(amount),
|
||||
@ -110,8 +108,6 @@ namespace Strawberry
|
||||
|
||||
if (hit != null)
|
||||
{
|
||||
ZeroRemainderY();
|
||||
|
||||
let c = Collision(
|
||||
Point.Right * sign,
|
||||
Math.Abs(amount),
|
||||
|
@ -35,6 +35,32 @@ namespace Strawberry
|
||||
}
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public void Move(Vector amount)
|
||||
{
|
||||
MoveX(amount.X);
|
||||
MoveY(amount.Y);
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public void MoveToX(float x)
|
||||
{
|
||||
MoveX(x - (X + remainder.X));
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public void MoveToY(float y)
|
||||
{
|
||||
MoveY(y - (Y + remainder.Y));
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public void MoveTo(Vector target)
|
||||
{
|
||||
MoveToX(target.X);
|
||||
MoveToY(target.Y);
|
||||
}
|
||||
|
||||
public abstract void MoveExactX(int amount);
|
||||
public abstract void MoveExactY(int amount);
|
||||
public abstract List<Actor> GetRiders(List<Actor> into);
|
||||
|
@ -6,14 +6,7 @@ namespace Strawberry
|
||||
public this(Point position, int width)
|
||||
: base(position)
|
||||
{
|
||||
Hitbox = Rect(0, 0, width, 6);
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
MoveY(-10 * Time.Delta);
|
||||
Hitbox = Rect(0, 0, width, 2);
|
||||
}
|
||||
|
||||
public override void MoveExactX(int amount)
|
||||
@ -80,7 +73,7 @@ namespace Strawberry
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
DrawHitbox(.(255, 255, 255, 255));
|
||||
DrawHitbox(.LightGray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,13 +10,6 @@ namespace Strawberry
|
||||
Hitbox = hitbox;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
MoveY(0.1f);
|
||||
}
|
||||
|
||||
public override List<Actor> GetRiders(List<Actor> into)
|
||||
{
|
||||
for (var a in Scene.All<Actor>(scope List<Actor>))
|
||||
|
Reference in New Issue
Block a user