GithubHelp home page GithubHelp logo

liliwen / space-shooter.c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tsherif/space-shooter.c

0.0 0.0 0.0 98.66 MB

A cross-platform, top-down 2D space shooter written in C using only platform libraries.

Home Page: https://tsherif.github.io/space-shooter.c/site/

License: MIT License

C 99.13% Makefile 0.25% HTML 0.35% GLSL 0.16% Batchfile 0.11%

space-shooter.c's Introduction

space-shooter.c

A cross-platform, top-down 2D space shooter written in C using only platform libraries.

gif

Dependencies

  • Base: Win32 (Windows), Xlib (Linux), Emscripten (Web)
  • Rendering: OpenGL 3.3 (Windows/Linux), OpenGL ES 3.0 (Web)
  • Audio: XAudio2 (Windows), ALSA/pthread (Linux), OpenAL (Web)
  • Gamepad: XInput (Windows), evdev (Linux), Emscripten (Web)

Description

space-shooter.c is a cross-platform, top-down 2D space shooter written in standard C11 using only platform libraries (with platform libraries defined as anything included in the C standard library or supported platforms). space-shooter.c has been tested on Windows 10, Ubuntu Linux 16.04, Chrome 103 and Firefox 103. This project drew heavy inspiration from Handmade Hero and pacman.c.

The design and architecture of space-shooter.c is described here.

Caveat

I am not a professional game developer, nor a professional C programmer, so the design may be unconventional or sub-optimal in many ways. Happy to take feedback from any pros out there!

Building

Windows

  • In a shell with cl set up, run build.bat for a debug build or build.bat release for an optimized build.
  • Run space-shooter.exe from the build/ directory.

Linux

  • Make sure development headers for the Linux kernel, Xlib, glx and ALSA are installed.
    • E.g. on Ubuntu, run the following: sudo apt install linux-libc-dev libx11-dev mesa-common-dev libasound2-dev
  • Run make linux for a debug build or make linux-release for an optimized build.
  • Run ./space-shooter from the build/ directory.

Web

  • Make sure make and emscripten are installed.
  • Run make web for a debug build or make web-release for an optimized build.
  • Serve the build/ directory for debug builds or the site/ directory for release builds from a local web server (e.g. python -m SimpleHTTPServer), and open the page in Chrome or Firefox.

What About Mac?

I hope to work on a Mac platform layer as soon as I have a Mac machine to work on.

Contributing

Since this project is intended as a personal challenge, I am not accepting external contributions at this time. I am very open to feedback, however, so feel free to open an issue for anything that needs fixing.

Asset Credits

space-shooter.c's People

Contributors

tsherif avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.