A platformer controlled through Twitch chat to be played on my stream during short breaks.
The only way to play is for Adam to be streaming the game. At that point, you can use the following commands in his Twitch chat:
join
: joins the game. Available at any time, although you'll only really stand a chance at winning if you join in the first ~45 seconds. 😉
To jump, you have to send one of the following commands in the chat: l
, u
, r
(see full list of aliases below). Optionally, you can adjust your angle and jump power.
Jump commands are currently accepted in the following format:
<direction> [angle] [power]
- where default values forangle
andpower
are0
and100
respectivelyangle
can be from-90
to90
.power
can be from1
to100
.
Both angle
and power
have a default value, so you don't have to type them in the chat. Omitting angle
will make you jump up, omitting power
will make you jump at maximum power. Commands were shortened to one character to make it easier to play.
Quick help:
l
(alias:e
) - jump left, e.g.l 45
ore 45
to jump ↖r
(aliases:j
,i
) - jump right, e.g.j 45
orr 45
to jump ↗︎u
- jump up, does not requireangle
, but allows specifyingpower
for weaker jumps, e.g.u 50
There are additional fixed-angle commands used as shortcuts:
rrr
,jjj
, oriii
: same asr 60
orj 60
rr
,jj
, orii
: same asr 30
orj 30
lll
oreee
: same asl 60
ll
oree
: same asl 30
angle input | -90 | -45 | 0 | 45 | 90 |
---|---|---|---|---|---|
jump direction | ← | ↖ | ↑ | ↗︎ | → |
Note
While angle
is clamped between -90
and 90
, that does not mean you have to put negative numbers in. This syntax was left in since j
became an alias - you can use j -30
to jump left or j 30
to jump right! Sometimes it's more convenient to stay on the j
key, so this might be a more preferred way to some players
To bypass duplicate message warning on Twitch, add some garbage letters after commands that you want to repeat:
u
: jump upu a
: jump up againu bbbb
: jump up again
Jumping in the same direction also works with garbage letters:
l 5
l 5 aaaa
l 5 bbb
This also works if you add them right after the command name, but only without space:
lk30
- interpreted asl 30
rrr50
- interpreted asrrr 50
Tip
Most important: you don't need to put space
between the command and angle
, you can simply send l30
to jump 30 degrees to the left (mind the angle input above: 0
degrees means up
)
Additional tips:
- You can alternate between
l
andr
commands to jump up in place, avoiding twitch duplicate message restriction. Jumping left or right with no angle specified allows you to jump up. - If you are using 7TV chat extension, it has its own duplicate message block prevention, so no additional garbage in the chat message is needed
Sending char <choice>
in the chat allows you to change your character graphic. This is only for cosmetics and will be saved between the sessions.
Note
Character customization is not saved during the Result Screen
choice
is a number from1
to18
glow [color]
: change your glow color. This is for subscribers, VIPs, and moderators only.- If
color
isn't specified, it'll take the color of your Twitch name. color
is in the formRGB
orRRGGBB
, e.g.color f00
to set it to red,color f0f
to set it to pink.
- If
namecolor <color>
: change your name color. This is for subscribers, VIPs, and moderators only.Color names
are allowed, e.g.red
,yellow
,tomato
. Refer to the X11 Color Name Chart for color names.Hexadecimal
values are also supported, e.g.f0c
,bd00cd
. Godot also supports4
-8
hex formats, but thealpha
component is discarded, player name transparency is not allowed.random
randomizes your name color.
- You can revive yourself using channel points. This isn't guaranteed to work, nor should you feel good about winning if you use this feature. 😛
- Designed live (see the design document)
- Developed hastily in three days (although there'll probably be minor improvements made in the future... 👀)
- Prerequisites:
- Install DotNet 8
- Install Godot ≥4.2
- Clone this repo
- Generate a twitch token for your twitch account: https://twitchtokengenerator.com/. You only need the scopes "chat:read" and "chat:edit" for now. Copy the access token and set it:
cd JumpRoyale
(i.e. your working directory should containJumpRoyale/JumpRoyale
and there should beJump Royale.csproj
in it)dotnet user-secrets set twitch_access_token <your access token>
dotnet user-secrets set twitch_channel_name <your channel name>
dotnet user-secrets set twitch_channel_id <your channel id>
- Ensure that you have a
GODOT4
environment variable:- Windows: modify system properties to set the environment variable to something like
C:\myPath\Godot_vx.y.z-stable_mono_win64.exe
- macOS: modify your shell's start-up script to add:
export GODOT4="/Applications/Godot_mono.app/Contents/MacOS/Godot"
- Windows: modify system properties to set the environment variable to something like
- Building:
- Navigate to the root directory with
Jump Royale.sln
- Run
dotnet restore
- Rebuild solution:
- VSCode: Run
dotnet build --no-incremental
(or run.NET: Rebuild
task if you have C# Dev Kit extension) - Visual Studio: Build -> Rebuild Solution
- VSCode: Run
- Open in Godot
- Click "Build" in Godot itself
- Navigate to the root directory with
- Running:
- Same as "building", but click "Run" in Godot
Note
When developing with VSCode, if any changes were made in the .editorconfig
file, you need to reload your window, because it will not pick up the changes immediately. Open Command Palette
and run Developer: Reload Window
task. This will most likely happen when switching to another branch that has different rules in .editorconfig
, so you might see warnings from old cached config.
On another note, you sometimes have to rebuild the solution for static analysis to detect the fixes (VSCode only).
Refer to Testing README
With VSCode, we heavily recommend installing the following Microsoft extensions:
- C#
- Additionally, C# Dev Kit is recommended for extra editor features: Testing, automatic Package Management and Project/Solution Explorer, but it is recommended to uninstall
IntelliCode for C# Dev Kit
from this pack; it only gets in the way. - Repository will recommend installing CSharpier extension, we recommend installing this extension as a default formatter, because the C# extension only provides fixes for whitespaces and CSharpier can actually handle line breaks in a way that it makes sense. Don't install as a global tool (updates will cause conflicts and the extension will not know which version to use).
In Arena.cs
:
- In
HandleCommands
, make a new case, decide if it needs theisPrivileged
argument (if the command is only for subs) - Create a new dictionary of aliases inside the provider
- Make a new command-specific matcher inside the provider
- Create a new method for the logic (no
defer
s needed!)
For example, assume there is a command that pushes a random player "left" or "right"
where the command format is: push [direction] // ← random if null
case string when CommandAliasProvider.MatchesPushCommand(command.Name):
HandlePush(stringArguments[0]);
break;