Tetris/Go: Difference between revisions

m
Fixed syntax highlighting.
(Added linked page)
 
m (Fixed syntax highlighting.)
 
(2 intermediate revisions by the same user not shown)
Line 1:
{{libheader|raylib-go}}
<br>
This is a translation of the sample [https://github.com/raysan5/raylib/blob/master/games/tetris.c#L455 Tetris Game] written in C for the original raylib library of which raylib-go is a Go wrapper.
 
The arrow keys control the game as follows:
Line 12:
Pressing the P key pauses the game and pressing it again resumes the game where it left off.
 
As currently written, the game only ashas one level (more than enough for me!).
 
The C game uses gray for all 7 pieces but I have changed this so that the active piece and the incoming (aka preview) piece display in the standard colors. However, when the active piece hits the bottom its color changes to gray as before.
<langsyntaxhighlight lang="go">package main
 
import (
Line 727:
UnloadGame()
rl.CloseWindow()
}</langsyntaxhighlight>
9,476

edits