lubocode / atoms-in-haskell Goto Github PK
View Code? Open in Web Editor NEWA small game programmed for a 30x12 RGB Display
License: Other
A small game programmed for a 30x12 RGB Display
License: Other
Functional Programming Project Concept: The player controls the movement of a white pixel. The player has to evade red pixels that spawn at an increasing rate at the top of the screen and move with constant velocity over the screen while getting deflected at the borders of the screen. If the player touches a red pixel, the game is over. Red pixels eventually turn green. When the player collides with green pixels, an explosion occurs that will destroy all the red and green pixels in a certain radius. The player is awarded with points for every destroyed pixel, using the formula points_awarded = (pixels_destroyed) ^ 2 After touching a red pixel, the total score is displayed and the player can start a new round. Player Interaction: The player can move the white pixel using the WASD keys. When displaying the score, the player can restart using SPACE. How it works: Every frame, the following procedure is executed: IF not playing display score ELSE handle input -> move white pixel update pixel positions & remaining time to turn green spawn new red pixel if needed detect collisions (set explosion, playing) IF explosion destroy pixels, update score display everything A few technical details: While the player has integer coordinates, all the other pixels have float coordinates. The system has its origin in the top left corner, positive x is to the right, positive y is down. The center of a display-pixel is (x.5, y.5) in the internal system, meaning that the white player-pixel on (x, y) is displayed on display coordinates (x, y) and red and green pixels are displayed on (floor x, floor y). While the position in the top row and the movement vector of new pixels is selected pseudo-randomly (using a Blum-Blum-Shub generator), the spawn is always in the half of the screen where the player is currently not and the direction is away from the player in order to avoid instant hittings. Notes for making: Main.hs needs to be compiled with stack ghc using the command "stack ghc -- --make Main.hs"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.