A Game of Drones by TD5

[raw]
made by TD5 for LD32 (COMPO)
Program a Defence Drone to protect yourself from the evil attackers. There's no direct control, only the forward-thinking and logic you feed into your program - this is your real weapon.

You write your code on the left side of the screen, click the red button and then see the battle play out on the radar display on the right.

The red and orange blips are enemies, and the green blips are friendly. The lighter green blip is the Defence Drone that your program controls, as you can tell by its label, which also shows its remaining health.

Each line is an action which your drone will do if the check after the 'when' check passes. The first line to pass its check has its 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 source code is made up of multiple lines, each line of the form:
when

If you try to run an invalid program, the game will complain at you once the drone queries its program, telling you the offending line. The drone is very picky, so having two spaces between parts of your commands or an extra space at the end of the command will make it break, so pay close attention to the error message.

The current checks are:
'always' which always applies
'isWithin' which takes a type of object (edge/enemy/friendly), distance (integer) and an optional direction (north/south/east/west) 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 25 north
fire south when enemy isWithin 25 south
fire east when enemy isWithin 25 east
fire west when enemy isWithin 25
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

This is an HTML5 game written in Elm. I didn't get as much done as I would have liked, so the game is missing a good introduction/tutorial and the parser isn't very forgiving, especially in terms of whitespace.

Ratings

Coolness 68% 3
Overall 2.51 1047
Fun 2.08 1082
Graphics 1.66 1079
Innovation 3.91 85
Mood 1.90 1020
Theme 2.78 920

Feedback

morgondag
20. Apr 2015 路 10:32 UTC
Hard!
dylanigan
20. Apr 2015 路 10:51 UTC
I liked the concept. for next time maybe add a scripting guide on the page, or a tutorial.
馃帳 TD5
20. Apr 2015 路 11:17 UTC
@dylanigan Yeah, I'm disappointed that I ran out of time and couldn't have added more commands with better explanations. Perhaps introducing new commands one at a time.
deadarius
20. Apr 2015 路 11:31 UTC
It is rather brilliant concept. Actually quite similar to mine, in a sense. But implementation is too hard to play.
Paulozz
20. Apr 2015 路 11:37 UTC
I love the concept but it's very hard to play ...
cgriff
20. Apr 2015 路 11:43 UTC
There seems to be a good idea in here, but at the moment it's just too hard to get into as a new player - it really needs some of these instructions displayed in the game itself. And it certainly is very picky on syntax! Great concept though, and it is satisfying to see the drone execute your commands. I really wanted to reprogram it on the fly...
馃帳 TD5
20. Apr 2015 路 11:52 UTC
@cgriff I considered reprogramming on the fly, but was worried that the game would become too much about typing quickly, but after playing deadarius's game, I'm starting to come around to that idea.
Pantelis Petsopoulos
20. Apr 2015 路 11:55 UTC
Great entry overall, very innovative, always good to see new stuff. I'm afraid it was a bit too unforgiving at the beginning, I don't see how a new player would sit through this.
WebFreak001
20. Apr 2015 路 12:14 UTC
I really liked the concept. But more scripting options would have been nice. Like variables, also adding random obstacles/using editor would have fitted perfectly. And including the readme from the compo page would have been nice.
elpaulo
20. Apr 2015 路 17:38 UTC
Keep working on it, it can be a wonderful game !
For now i always generate errors, but i'm gonna retry :-)
馃帳 TD5
20. Apr 2015 路 17:42 UTC
@elpaulo Yeah, I am sorry about that. I was trying to fix that part towards the end, but I was just too damn tired to think. Thanks for your patience and kind words :)
madameberry
20. Apr 2015 路 20:07 UTC
I couldn't seem to get a handle on the syntax, my guy didn't do much of anything.
PaperBlurt
21. Apr 2015 路 06:19 UTC
This feels very contemporary as working with drones.
Nice job!
wg_phancock
21. Apr 2015 路 07:29 UTC
Pretty cool concept, but seems to get frequent source code errors.
Smirnov48
22. Apr 2015 路 01:01 UTC
Hard game! But interesting. Difficult to start, and example program doesn't works.
ito123456789
22. Apr 2015 路 01:31 UTC
A more polished version of this would be awesome! Great concept!
sanojian
22. Apr 2015 路 15:56 UTC
Some interesting ideas here. Could be very good with a little more work.
eemmbbeerr
24. Apr 2015 路 16:01 UTC
Good idea. But I think it would be better if the game didn't restart when I uploaded a new code to the drone. That way, I could reprogram it in-battle. I think bullets should be visible, and I don't get why the rouge soldier didn't die when it was right next to me, only there was a friendly power station in between us. Do friendly objects stop bullets? In that case, the AND logical operator should be implemented so I could check if there was a friendly building in between us and I wont shoot it.
gnx
24. Apr 2015 路 20:56 UTC
Interesting entry. Took me a while to get it working before I realized pasting the sample program in the textarea adds whitespace at line endings, which makes the execution fail.

So maybe trim your input and it is bit easier to get into.
Extra points for the theme approriate gfx :)
GBGames
28. Apr 2015 路 02:54 UTC
Very neat concept! I wish I could tell the drone to move based on a position southwest or northeast.
kunzbe
02. May 2015 路 11:54 UTC
intersting concept. somehow i really did not like the textbased user interface (maybe it felt too much like programming ;) ). Maybe you could have done something like logical blocks that the player can arrange like in visual programming environments
LadyEmaSkye
07. May 2015 路 16:31 UTC
It's a REALLY Interesting concept, but with one crucial problem. It is VERY confusing. There is no tutorial, guide or ANYTHING in the actual game, you just get thrown right into it! And when the game closes everytime you try to start it it makes it very hard to actually learn how to do anything.
uberscientist
10. May 2015 路 00:30 UTC
ooo I've wanted to try Elm sometime, seems like a good way of writing programs/games for the web. Innovative entry!