Skip to content

gjones007/far_into_space

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This game is not directly buildable without extending Raylib 5.0 and the Odin binding a little bit. I did this to push particle buffers and allow for raymarching shaders (as point buffers) to render the asteroids to the GPU. Raylib does not support this feature directly.

In the Odin vendor library, I extended vendor/raylib/rlgl.odin to include

rlDrawArrays          :: proc(mode: c.int, offset: c.int, count: c.int) ---
rlBindVertexArray     :: proc(array: c.uint) ---

then in raylib/src/rlgl.h

// passthru for glDrawArrays
void rlDrawArrays(int mode, int offset, int count)
{
    glDrawArrays(mode, offset, count);
}
 
void rlBindVertexArray(unsigned int array)
{
    glBindVertexArray(array);
}

You need to build Raylib then and copy the update libraries into your platforms directory, i.e. in my case Odin/vendor/raylib/linux.

You also need to build box2c (as documented below), for both native and WASM (if you build WASM).

This served as a template for building WASM binaries that would run in a browser.

Graphics from Kenny

- 2D assets/Space Shooter Redux/
- 2D assets/Space Shooter Extension/

Sounds from

Space shooter sound fx pack 1 by Dravenx

Some of the sounds, I created.

Music

I made for this game.

Browser target specifics

  • Renderer: WebKit WebGL
  • Version: OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))
  • GLSL: OpenGL ES GLSL ES 1.00 (WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium))

Physics Engines

Box2c build

CXX=clang++ CC=clang cmake -B ./build-linux -DCMAKE_BUILD_TYPE=Debug -DBOX2D_SAMPLES=OFF
cmake -B ./build-linux -DCMAKE_BUILD_TYPE=Debug -DBOX2D_SAMPLES=OFF -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang 
. ~/emsdk/emsdk_env.sh
emcmake cmake -B ./build-wasm32 -DCMAKE_BUILD_TYPE=Debug -DBOX2D_SAMPLES=OFF -DBOX2D_AVX2:BOOL=OFF
cd build-wasm32
emmake make

Raylib build

. ~/emsdk/emsdk_env.sh
emcmake cmake -B ./build-wasm32 -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
cd build-wasm32
emmake make

Releases

No releases published

Packages

No packages published