* tetris!
* softdropping & left,right key holding
* started work on the ui
* playable state
* there you go exp
* multiuser rework
* ui update refactor
* blockgame™️
* highscores, keybindings, ui refactor
* speed adjusts
leveling
* highscorebackground tweak
speed tweak
* NULLABLE
* yes
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using Robust.Shared.Maths;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Arcade
|
|
{
|
|
[Serializable, NetSerializable]
|
|
public struct BlockGameBlock
|
|
{
|
|
public Vector2i Position;
|
|
public readonly BlockGameBlockColor GameBlockColor;
|
|
|
|
public BlockGameBlock(Vector2i position, BlockGameBlockColor gameBlockColor)
|
|
{
|
|
Position = position;
|
|
GameBlockColor = gameBlockColor;
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum BlockGameBlockColor
|
|
{
|
|
Red,
|
|
Orange,
|
|
Yellow,
|
|
Green,
|
|
Blue,
|
|
LightBlue,
|
|
Purple
|
|
}
|
|
}
|
|
|
|
public static class BlockGameVector2Extensions{
|
|
public static BlockGameBlock ToBlockGameBlock(this Vector2i vector2, BlockGameBlock.BlockGameBlockColor gameBlockColor)
|
|
{
|
|
return new BlockGameBlock(vector2, gameBlockColor);
|
|
}
|
|
|
|
public static Vector2i AddToX(this Vector2i vector2, int amount)
|
|
{
|
|
return new Vector2i(vector2.X + amount, vector2.Y);
|
|
}
|
|
public static Vector2i AddToY(this Vector2i vector2, int amount)
|
|
{
|
|
return new Vector2i(vector2.X, vector2.Y + amount);
|
|
}
|
|
|
|
public static Vector2i Rotate90DegreesAsOffset(this Vector2i vector)
|
|
{
|
|
return new Vector2i(-vector.Y, vector.X);
|
|
}
|
|
|
|
}
|
|
}
|