Nanotrasen Block Game is here (#2131)
* 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
This commit is contained in:
53
Content.Shared/Arcade/BlockGameBlock.cs
Normal file
53
Content.Shared/Arcade/BlockGameBlock.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user