Giter VIP home page Giter VIP logo

ld32's Introduction

A Game of Drones - Play it here

My entry for Ludum Dare 32 - Make a game in 48 hours under the theme, "An Unconventional Weapon".

Program a drone to defend against the evil attackers. There's no direct control, only the forward-thinking and logic you feed into your program - this is your real weapon.

Each line is an action which your drone will do if the check after the "when" passes. The first line to pass it's check has it's action executed. Each time your drone wants to do something, it will consult your program, and do nothing if none of your rules apply.

The current checks are: always which always applies isWithin which takes a type of object, distance and an optional direction and checks to see if an object of a given type is within the given distance (and maybe also in the given direction)

The actions are: fire which takes a direction move which takes a direction wait which takes no parameters

Example program:

fire north when enemy isWithin 12 north
fire south when enemy isWithin 12 south
fire east when enemy isWithin 12 east
fire west when enemy isWithin 12 west
move south when edge isWithin 2 north
move north when edge isWithin 2 south
move east when edge isWithin 2 east
move west when edge isWithin 2 west
move south when always

The game is written in Elm, using Vim, Elm Reactor and Safari.

This was my first attempt to write something more than a Hello World! program in Elm. I chose Elm because I wanted a bigger challenge than my last Ludum Dare entry, and what better way than to drop myself in the deep end with a new language and a different programming paradigm? I didn't get very close to finishing the game, but I learnt a lot about Elm, so I consider the exercise a win.

ld32's People

Contributors

td5 avatar

Watchers

 avatar  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.