102 lines
1.7 KiB
Markdown
102 lines
1.7 KiB
Markdown
# glider-pixel
|
|
|
|
Génération d'images à la "jeu de la vie" écrit en C.
|
|
|
|
"Game of life" like image generation written in C.
|
|
|
|
- - - - - - - -
|
|
# Install
|
|
|
|
## Fedora / RedHat :
|
|
```
|
|
# dnf install gcc
|
|
# dnf install SDL_image
|
|
# dnf install SDL_image-devel
|
|
```
|
|
|
|
## Debian :
|
|
```
|
|
# apt install gcc
|
|
# apt install libsdl-image1.2
|
|
# apt install libsdl-image1.2-dev
|
|
# apt-get install libsdl1.2-compat ( might be needed, or not )
|
|
```
|
|
|
|
- - - - - - -
|
|
# Compile
|
|
|
|
## Fedora / RedHat :
|
|
```
|
|
$ gcc `sdl-config --cflags --libs` glisseur_10.c -o glisseur_10
|
|
```
|
|
|
|
## Debian :
|
|
```
|
|
$ gcc -o glisseur_10 glisseur_10.c `sdl-config --cflags --libs`
|
|
```
|
|
|
|
- - - - - - -
|
|
# Run
|
|
```
|
|
$ ./sdl-glisseur_10
|
|
```
|
|
|
|
- - - - - - -
|
|
# Kill
|
|
```
|
|
$ top (or ps ax) ---> get PID of the glider proccess
|
|
$ kill -9 PID
|
|
```
|
|
or try many times to close window
|
|
|
|
- - - - - - -
|
|
# Adjust image size
|
|
|
|
Update WIDTH and HEIGHT on
|
|
```
|
|
// Canvas height and width //
|
|
#define WIDTH 640
|
|
#define HEIGHT 480
|
|
```
|
|
|
|
- - - - - - -
|
|
# Set up the 4 colors
|
|
|
|
```
|
|
// Canvas height and width //
|
|
#define WIDTH 640
|
|
#define HEIGHT 480
|
|
```
|
|
|
|
- - - - - - -
|
|
# Set up the 4 colors
|
|
```
|
|
// 4 colors definition //
|
|
#define COLOR_0_R 254
|
|
#define COLOR_0_G 254
|
|
#define COLOR_0_B 254
|
|
#define COLOR_1_R 254
|
|
#define COLOR_1_G 0
|
|
#define COLOR_1_B 0
|
|
#define COLOR_2_R 0
|
|
#define COLOR_2_G 254
|
|
#define COLOR_2_B 0
|
|
#define COLOR_3_R 0
|
|
#define COLOR_3_G 0
|
|
#define COLOR_3_B 254
|
|
```
|
|
|
|
- - - - - - -
|
|
# Change glider moving rules
|
|
Update the direction adding parameters, check examples from line 158 to line 205
|
|
|
|
- - - - - - -
|
|
# Border bounce or pass through
|
|
Comment / uncomment bounce and pass through blocks on line 288 to 351
|
|
|
|
|
|
- - - - - - -
|
|
# Let's glide !
|
|
|
|

|