All Projects → evancz → Elm Playground

evancz / Elm Playground

Licence: bsd-3-clause
Create pictures, animations, and games with Elm!

Programming Languages

elm
856 projects

Projects that are alternatives of or similar to Elm Playground

Rpg tactical fantasy game
A tactical turn-based game project in pygame, open to support
Stars: ✭ 66 (-27.47%)
Mutual labels:  games
Metalbrot Playground
An interactive playground showing how to use Metal compute kernels.
Stars: ✭ 78 (-14.29%)
Mutual labels:  playground
Playground
A space to learn and experience CodeIgniter 4
Stars: ✭ 84 (-7.69%)
Mutual labels:  playground
Visualprogramminglanguage
Visual programming language written in Swift that assembles to executable Swift code. WWDC '18 scholarship submission.
Stars: ✭ 1,145 (+1158.24%)
Mutual labels:  playground
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-17.58%)
Mutual labels:  playground
Extractdata
An extraction tool for visual novels. Originally developed by Yuu.
Stars: ✭ 79 (-13.19%)
Mutual labels:  games
Swift Framework C Library Example
Example of a simple Swift framework that integrates with a C library without bridging headers.
Stars: ✭ 63 (-30.77%)
Mutual labels:  playground
Everpuzzle
Tetris Attack / Pokemon Puzzle style game written in Rust
Stars: ✭ 88 (-3.3%)
Mutual labels:  games
Titlerun
The game that only exists in your title bar
Stars: ✭ 77 (-15.38%)
Mutual labels:  games
Emojivision
A 200 something line Swift Playground for rendering images as emojis
Stars: ✭ 84 (-7.69%)
Mutual labels:  playground
Audiokit
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
Stars: ✭ 8,827 (+9600%)
Mutual labels:  playground
Games
一个基于Phaser的小游戏集合
Stars: ✭ 1,167 (+1182.42%)
Mutual labels:  games
Black Playground
ambv/black online demo
Stars: ✭ 83 (-8.79%)
Mutual labels:  playground
Codeworld
Educational computer programming environment using Haskell
Stars: ✭ 1,142 (+1154.95%)
Mutual labels:  playground
Scoop Games
Scoop bucket for open source/freeware games and game-related tools
Stars: ✭ 85 (-6.59%)
Mutual labels:  games
Igdb
Go client for the Internet Game Database API
Stars: ✭ 65 (-28.57%)
Mutual labels:  games
Pixelartmaker
A pixel art editor in a Swift Playground 👾 WWDC Scholarship Winner 🏅
Stars: ✭ 79 (-13.19%)
Mutual labels:  playground
Langaw
A sample project for following along a tutorial found on jap.alekhin.io.
Stars: ✭ 90 (-1.1%)
Mutual labels:  games
Shaderview
A library for simple shader programming
Stars: ✭ 87 (-4.4%)
Mutual labels:  playground
Project Dollhouse
A project aiming to rebuild TSO (The Sims Online) from the ground up. Inspired by CorsixTH.
Stars: ✭ 83 (-8.79%)
Mutual labels:  games

Elm Playground

Create pictures, animations, and games with Elm!

This is the package I wanted when I was learning programming. Start by putting shapes on screen and work up to making games. I hope this package will be fun for a broad range of ages and backgrounds!

Pictures

A picture is a list of shapes. For example, this picture combines a brown rectangle and a green circle to make a tree:

import Playground exposing (..)

main =
  picture
    [ rectangle brown 40 200
    , circle green 100
        |> moveUp 100
    ]

Play around to get familiar with all the different shapes and transformations in the library.

Animations

An animation is a list of shapes that changes over time. For example, here is a spinning triangle:

import Playground exposing (..)

main =
  animation view

view time =
  [ triangle orange 50
      |> rotate (spin 8 time)
  ]

It will do a full spin every 8 seconds.

Maybe try making a car with spinning octogons as wheels? Try using wave to move things back-and-forth? Try using zigzag to fade things in-and-out?

Games

A game lets you use input from the mouse and keyboard to change your picture. For example, here is a square that moves around based on the arrow keys:

import Playground exposing (..)

main =
  game view update (0,0)

view computer (x,y) =
  [ square blue 40
      |> move x y
  ]

update computer (x,y) =
  ( x + toX computer.keyboard
  , y + toY computer.keyboard
  )

Every game has three important parts:

  1. memory - Store information. Our examples stores (x,y) coordinates.
  2. update - Update the memory based on mouse movements, key presses, etc. Our example moves the (x,y) coordinate around based on the arrow keys.
  3. view - Turn the memory into a picture. Our example just shows one blue square at the (x,y) coordinate we have been tracking in memory.

When you start making fancier games, you will store fancier things in memory. There is a lot of room to develop your programming skills here: Making lists, using records, creating custom types, etc.

I started off trying to make Pong, then worked on games like Breakout and Space Invaders as I learned more and more. It was really fun, and I hope it will be for you as well!

Share Your Results!

If you make something cool, please share a picture, GIF, or video on Twitter! Add #elmlang so we can find it!

And if you start using this package for teaching, please share about that the same way! I know McMaster Outreach has been using a previous iteration of this package to help 4th through 8th graders learn some programming, and I love seeing all the pictures and animations that have come out of that!

Future Work

I think it would be great to develop some learning resources that use "making games" as motivation for learning lists, records, custom types, etc.

My learning path was attempting to recreate Pong, then Breakout, then Space Invaders, and then Zelda. This sequence of games started me off just thinking about math for collisions, then about using lists to track many collisions, then making things fancier to handle moving ships, and finally, working with complex characters with health and inventory. Each new game built on the ones before, introducing new concepts gradually and giving me a long time to get comfortable with them.

That is what I did, but I think people should explore this independently! Maybe you have a path that works well for their 10th graders, maybe someone else has a path that works well for their 5th graders, etc.

My instinct is that we can make it really fun to learn programming, and I am excited to hear about anyone who makes progress in that general direction. So please share your materials and results!

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