All Projects → axelson → scenic_asteroids

axelson / scenic_asteroids

Licence: BSD-3-Clause License
A toy Asteroids clone written in Elixir with the Scenic UI library

Programming Languages

elixir
2628 projects
CSS
56736 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to scenic asteroids

nodejs-cron-job-must-know
it is an example of running node.js script with every certain period(cron job)
Stars: ✭ 35 (-16.67%)
Mutual labels:  example
PoC-Examples
This repository contains synthesizable examples which use the PoC-Library.
Stars: ✭ 27 (-35.71%)
Mutual labels:  example
widgets playground
Showcase example for https://github.com/therecipe/qt
Stars: ✭ 50 (+19.05%)
Mutual labels:  example
waypoint-plugin-examples
An example repository that demonstrates how to create and run an external Waypoint plugin
Stars: ✭ 16 (-61.9%)
Mutual labels:  example
Chat-Server
Simple chatroom in C
Stars: ✭ 74 (+76.19%)
Mutual labels:  example
todo-graphql-example
Example Todo app on top of json-graphql-server
Stars: ✭ 20 (-52.38%)
Mutual labels:  example
go-project-template
A template for new Go projects.
Stars: ✭ 20 (-52.38%)
Mutual labels:  example
SeatLayout
A seat selection library for Android with an example for selecting seats for flights, sports venue, theatres, etc
Stars: ✭ 30 (-28.57%)
Mutual labels:  example
credit-card-example
An example of credit card made by using Rivets Js
Stars: ✭ 23 (-45.24%)
Mutual labels:  example
ksonnet-cheat-sheet
No description or website provided.
Stars: ✭ 18 (-57.14%)
Mutual labels:  example
graphql-reason-server-example
An example project to write a GraphQL server using Reason
Stars: ✭ 19 (-54.76%)
Mutual labels:  example
typeorm-example
Example Web API for TypeORM + TypeDI + routing-controllers
Stars: ✭ 27 (-35.71%)
Mutual labels:  example
play-scala-chatroom-example
Play chatroom with Scala API
Stars: ✭ 43 (+2.38%)
Mutual labels:  example
bash-streams-handbook
💻 Learn Bash streams, pipelines and redirection, from beginner to advanced.
Stars: ✭ 153 (+264.29%)
Mutual labels:  example
riot realworld example app
Exemplary real world application built with Riot.js v6 🖐👍
Stars: ✭ 16 (-61.9%)
Mutual labels:  example
go-grpc-bidirectional-streaming-example
gRPC bidirectional streaming example written in golang
Stars: ✭ 83 (+97.62%)
Mutual labels:  example
Quarto
A working example of the Quarto board game using Elm and Netlify. An exploration of game development, OSS, and functional programming.
Stars: ✭ 15 (-64.29%)
Mutual labels:  example
rest-api-endpoints
🌾 WordPress REST API endpoints
Stars: ✭ 31 (-26.19%)
Mutual labels:  example
Discord-Bot-TypeScript-Template
Discord bot - A discord.js bot template written with TypeScript.
Stars: ✭ 86 (+104.76%)
Mutual labels:  example
example-orbitdb-todomvc
TodoMVC with OrbitDB
Stars: ✭ 17 (-59.52%)
Mutual labels:  example

Scenic Asteroids Logo

Scenic Asteroids

Demo of Gameplay

This is an Asteroids clone written in Elixir with Nerves, more for fun and learning than for anything else. Also since the code (and behavior) is relatively simple, I hope that it can serve as an example for Scenic, Nerves, and as a simple poncho project.

It is licensed under the 3-clause BSD license (see LICENSE) for details.

Instructions

From the root of the repository run the following commands:

Note: if scenic doesn't launch then you may be affected by the bug boydm/scenic_new#36

Keys:

  • W - Move up
  • A - Move left
  • S - Move down
  • D - Move right
  • SPC - Shoot an asteroid

Use the mouse to target the asteroids (or your finger if you're running with a Nerves touch screen)

Have fun!

Implementation Notes

SchedEx is used to implement the core animation timer which runs at a rate of 60 frames per second.

Collision detection is incredibly basic and non-performant. Ideally either scenic or a cooperating library would implement some collision detector helpers. If you're interested in collision detection then please contribute to Scenic issue #91.

Projects

  • play/ - The main game logic
  • play_ui/ - Run via scenic on the desktop
  • fw/ - Run on a Nerves device with a touchscreen
    • Official Raspberry PI touch screen is supported

JS Multiplayer (in progress)

TODO:

  • Get basic nerves install working on network
  • Run scenic play application on nerves!
  • Add multiplayer via Phoenix channels
    • Add single player control via browser
    • Ask for player name
    • Add a waiting screen/lobby
  • Splash screen add option to choose single player or multiplayer
    • Logo will come down and then the options appear
    • Pressing "SPC" or "s" will start single player immediately
    • Pressing "m" will start multi player immediately
  • Test possibility of rendering the current scene to an html canvas

The player javascript will record action states (not key states) Actions:

  • move_aim_direction (vector)
    • Note: This will also be used for aiming direction
  • move_up
  • move_right
  • move_down
  • move_left
  • aim_direction (vector)
  • shoot

NOTE: if move_aim_direction is used then the other move and aim actions should not be used. This will be enforced on the server-side.

  • Channel actions
    • set:actions
      • When the channel receives this it will do a GenServer.cast to the Asteroids scene to update that players currently set actions
      • If the channel process goes down, the scene will clear all actions for that player
        • Perhaps this can be accomplished with a process link?
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].