Code Monkey home page Code Monkey logo

gnumaku's Introduction

Gnumaku

About

Gnumaku is (trying to be) a libre game engine for creating bullet hell shooting games in the Scheme language.

Screencast

Another screencast

Tech

Gnumaku is written in C and Scheme. GNU Guile is the Scheme implementation used, as it is the official GNU extension language and fairly easy to work with.

The Allegro 5 game library has been chosen for it's simplicity and use of OpenGL accelerated rendering rather than software rendering.

A good shootemup engine requires a way to make awesome bullet patterns easily. Gnumaku features a robust bullet system capable of processing thousands of bullets efficiently. Bullets have many customizable properties and can be manipulated after they are emitted for creating complex behavior.

Writing scripts using the built-in coroutines is an easy way to write a bullet pattern in a logical, linear fashion.

Here's what a simple bullet script might look like:

(define-coroutine (player-shot-1 player)
  (when (shooting player)
    (play-sample (shot-sound player) 1 0 1)
    (let ((pos (position player))
          (speed 15)
          (bullets (bullet-system player))
          (type 'sword))
      (emit-bullet bullets pos speed 269 type)
      (emit-bullet bullets pos speed 270 type)
      (emit-bullet bullets pos speed 271 type))
    (wait player 3)
    (player-shot-1 player)))

This script first checks if the player's shooting flag is currently set. If so, 3 bullets are fired and a sound sample is played. The bullets are emitted from the player's bullet system. The bullets have a speed of 15 pixels per second. They are fired from the player's current location with directions of 269, 270, and 271 degrees, respectively. 'sword refers to the type of bullet to fire. Bullet types define the image, hitbox, and blend mode that the bullet has. The procedure is then stopped and scheduled in the player's agenda to resume after 3 frames have passed. When the script continues, we recursively call the procedure and the process repeats until the player is no longer in the shooting state.

It should be noted that the Gnumaku engine isn't strictly for shootemup games. Gnumaku provides the building blocks to make many other types of games.

Additional Gnumaku features:

  • Tilesets
  • Sprites
  • Sound effects and music
  • 2D scene graph
  • Particle effects

Dependencies

GNU Guile >= 2.0 Allegro >= 5.0

Note: Guile 2.0 currently has issues compiling on Windows. Until that is resolved, Gnumaku cannot run on Windows.

Try the Demo!

make
make run-demo

License

GNU GPL v3

Thanks

Thanks to mark_weaver and ijp for helping me with everything Scheme and Guile related on a regular basis.

Thanks to wingo for his coroutine implementation.

Thanks to MIT Press for SICP.

Thanks to the fine folks on the #guile and #allegro rooms on freenode.

gnumaku's People

Contributors

davidgomes avatar mxnemu avatar nalaginrut avatar

Watchers

 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.