Neural Network Training with Games
Adapted for Linux/Mac
Credits JVictorDias
Deps
- sdl2
- sdl2-ttf
- sdl2-image
- libwebp
- make
- g++/clang++
- docker (optional)
Linux
sudo apt install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libwebp-dev libgsl-dev
or
make docker-compile-all
Mac
sudo brew install sdl2 sdl2-ttf sdl2-image gsl
How to test
Flappy-Bird
make run-flappy
or
make docker-run make run-flappy
for mac
make docker-mac-run make run-flappy
key | Action |
---|---|
esc | Pause |
space | info |
Deep-Cars
make run-cars
Dinossauro
make run-dino
Tecelao
make run-tecelao
Parameters (input.txt)
Digite o nome da sua imagem (exemplo: teste.bmp): iron.bmp
Digite a quantidade de pregos (maximo 1000): 1000
Digite a quantidade de linhas: 1800
Digite a taxa de reducao do pixel (255 retira o pixel todo, 0 nao retira nada): 255
Left mouse click + ENTER to start
Commands
key | Action |
---|---|
a | Left |
d | Right |
w | Up |
s | Down |
q | Zoom In |
e | Zoom Out |
z | ReDraw |
ENTER | Start |
ParticulasGravitacionais3D
make run-particulas
key | Action |
---|---|
a | Left |
d | Right |
w | Up |
s | Down |
q | Zoom In |
e | Zoom Out |
h | Rotate Up X |
y | Rotate Down X |
g | Rotate Left Y |
j | Rotate Right Y |
ENTER | Join particles |
Mouse Left | Expand particles |
Spirograph
make run-spirograph
key | Action |
---|---|
ENTER | Next |
HardestGame
make run-hardestgame
key | Action |
---|---|
F2 | Load next map |
ENTER | Start map |
HardestGameEditor
make run-hardestgame-editor
key | Action |
---|---|
d/f | Angulo de troca |
cima/baixo | Tamanho grade |
j/k | Tempo parado |
g/h | Angulo parada |
i | Salvar posicao mouse |
u | Carregar posicao salva |
F1 | Salvar mapa |
F2 | Carregar mapa |
Docker with X11 on MAC
Make sure to install XQuartz
brew install socat
brew cask reinstall xquartz
Don't forget to close logout and log back in.
- Close any 6000
On a new terminal, verify if there's anything running on port 6000
lsof -i TCP:6000
If there is anything, just kill the process
-
Close any 6000 Open a socket on that port and keep the terminal open
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:"$DISPLAY"
-
Verify 6000 is open In a new terminal, verify if it is opened
lsof -i TCP:6000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME socat 29298 mdesales 5u IPv4 0xe21e43ca9d99bf1d 0t0 TCP *:6000 (LISTEN)
Copy and paste this into a Terminal window of your Mac
sudo defaults write org.macosforge.xquartz.X11 enable_iglx -bool true