Rockfall. A game where rocks fall

Overview

RockFall

Live Version

Make your own levels and contribute them here!

See instructions here.

Rules

  • 🙂 Player: A, S, D, W or ⬅️ , ➡️ , ⬆️ , ⬇️ to move

  • 🧧 Exit: Opens when you've collected 'goal' number of diamonds/eggs

  • 🔳 Open Exit: Completes the level

  • 🟫 Dirt: Can be dug

  • ⬜️ Wall: Unmovable, un-diggable, but explodable

  • 🟪 Border: Un-explodable

  • 🌑 Rock: Pushable left or right.

  • 💎 Diamond: 100 points

  • 🦋 Butterfly: Turns left. If something falls on it or it touches an amoeba 🦠 it explodes into 9 eggs. Deadly to player.

  • 🥚 Egg: Worth 10 points, Hatches into Butterfly

  • 👾 Guardian: Turns right. If something falls on it explodes into space. Deadly to player.

  • 🦠 Amoeba: Grows. If it reaches 100 Amoeba they all turn to eggs. If it's surrounded so it can't grow they all turn into diamonds.

  • 🦀 goes only left/right or up/down

  • 🪲 only turns when it hits something

  • 🚪 player can pass through but nothing else.

  • 💣 explodes when it falls on anything but dirt or when touched by an enemy.

  • 🏧 Magic Wall: The first time something drops on it it turns on. While on, any rock or egg dropped on it will become a diamond. Any diamond dropped on it will become a rock. Stops after a few seconds.

Rocks, Bombs, Eggs, and Diamonds will fall if there is space below them or if they are sitting on top of another rock, egg, or diamond and there is space for them to fall.

You can restart by clicking in the top left corner or select another level by clicking the name.

Note: You can dig one tile without moving by holding shift.

The first level is random so and there is no real theme so it's just a proof of concept. In fact given it's random it's possible it's impossible to complete. If so click the 🔄 icon to generate a new level. If you get stuck you can kill yourself by clicking the ☠️ icon. Note that having the entrance blocked means you can't do the level but having the exit blocked may mean you can challenge yourself to lure some enemies over there and drop rocks on them to mine a way into the exit 😛

A real game would require hand designed or algorithmically generated levels.

Settings

These settings can be set with query parameters

property default description
amoebas 1 number of amoebas
butterflies 5 number of butterflies
diamonds 15 number of diamonds
guards 3 number of guardians
rocks 280 number of rocks
walls 10 number of walls
magicWalls 2 number of magic walls
maxAmoebas 100 how many amoebas when it turns into eggs
amoebaGrowthRate 200 lower is faster
amoebaMinTicksToGrow 50 Force the amoeba to grow within this many ticks
magicTime 250 how many ticks the magic walls stay active
tileSize 32 size of tiles (note
scrollRate 0.0125 scroll speed
diamondPoints 100 points for collecting diamond
eggPoints 10 points for collecting egg
dirtPoints 1 points for digging dirt
mapWidth 80 map width in tiles
mapHeight 25 map height in tiles
frameRate 0.1 frame rate in seconds
colorVariation 1 color variation multiplier. Set to 0 for no variation
requiredCount 15 count (eggs + diamonds) needed to open exits
timeLimit 1500 time limit in seconds
maxPushRocks 100000 max rocks that can be pushed
pushTurnsPerRock 1 turns per rock to push (set to 0 for same speed regardless of number of rocks)
minRockPushTurns 1 number of turns until you can start pushing rocks (set to 0 for instant)
canPushWithRocksAbove true can push with rocks above
playerBoundsWidthPercent 0.125 size of window to keep player inside
playerBoundsHeightPercent 0.125 size of window to keep player inside
level 0 level to use (see here)

Examples:

History

In the early 1980s, a game, BoulderDash came out for the Atari 800. My friend, John and I, got addicted and cleared all the levels.

At some point John tried to reproduce the main logic of the game. He did this in a language called Action!. It's pretty incredible to think someone stuck a language compiler and editor in a 16k cartridge!

In any case, John got something working. The code was not all that big. As such, over the years I've ported it several times. I ported it to C at some point. According to the comments that was 1992.

I once ported it to Z80 assembly for the original GameBoy when I was first learning how it works. I ported it to Java for some feature phone around 2003-2004 to bring to a job interview at Namco Japan for their mobile division.

Recently (March 2022) I was going though some old backups and I saw it sitting there and decided it might be fun to port it to JavaScript.

My first attempt was to use emoji and Canvas 2D.

After that I thought it would be fun to use the tilemap shader I wrote for HFT-BoomBoom.

This is the result.

Note: Differences from the original:

In the original, Butterflies explode into diamonds, not eggs. It would probably be best to make a 3rd enemy that explodes into diamonds for the variety but in these random levels it's arguably more fun that butterflies explode into eggs so you can see lots of movement. Also in the original you can only push a single rock. If 2 or more rocks are in a row they can not be pushed.

Design

Currently the first level is just randomly generated.

For this game to be fun really requires well designed levels. The original Atari game had 60 or so levels. Each level had themes, a required number of items to open the exit, and a time limit. In other words, if the level required 40 items then you'd need to collect 40 diamonds or eggs to open the exit and then make it to the exit before the time limit.

The first few levels were mostly just rocks, walls, and diamonds. Some levels had less than the required diamonds but had butterflies so if you dropped rocks on them they'd generate diamonds. Other levels, some diamonds might be surrounded by walls so you need to lure guardians next to the walls and drop rocks on their heads to explode the walls.

Another example was the magic wall. It turns rocks into diamonds but you can only use it once. So, you'd need to dig around and push as many rocks as possible into position and also dig out space below the magic wall so that once you turned it on you could push all the rocks into the magic wall and have them all turn into diamonds.

Yet another example was having the amoeba at the bottom of some level and you'd need to find a way to surround it with rocks so that it turned into diamonds before it grew too big and turned into eggs and then butterflies.

Anyway, all of those are interesting puzzles to solve but they require a level designer. PRs welcome!

Building levels

See instructions here.

Enhancements / Ideas

At the moment I just used the system's emoji for graphics. Ideally, at a minimum, someone would draw custom graphics including animated tiles for the gem spinning, the butterfly flapping, the monsters moving, the amoeba oozing, the magic wall animating, the egg hatching, explosions.

It might also be fun to try to make the graphics appear to not be tile based but actually keep them tile based. Change the shader (or the game logic) to add edge tiles. Add something to the shader to offset moving characters over time. etc...

Add more rules, entities: The number one reason I wrote this was I thought it might be fun to make more types of things. Random simple ideas:

  • Enemies that only go left/right or up/down 🦀
  • Enemies that only turn when they hit something 🪲
  • Enemies that path find
  • Water (can flow left/right and go down, maybe Diamonds float up in water, maybe rocks fall slower)
  • Gas (can flow left/right and go up, maybe can light gas on fire)
  • Balloons (float up, opposite of rocks)
  • Fire (spreads. Maybe need something burnable)
  • Bombs (make chain explosions) 💣
  • Bomberman Bombs (bombs that fill space and eat just one edge of dirt)
  • Ice Rocks (rocks that when pushed continue left/right)
  • Ice Bombs (bombs that when pushed continue left/right)
  • Diggers (enemies that dig dirt)
  • Diamond eaters (enemies that eat diamonds)
  • Diamond makers (enemies that eat rocks and hatch diamonds)
  • Feed - touch it and for the next N seconds you drop (dirt, monster food)
  • Doors - you can go through, monster can't 🚪
  • Doors the open and close on pass through
  • Rotation (the GPU renderer can draw at any angle so, turn 45 degrees and have rocks slide. Or turn 90, 180, 270, and down is a new direction. this could be random, or time based, or there could be an object you touch to rotate or 4 objects to orient or drop a rock on etc...)

To be honest I think an actual shipping game would be best with a few core features and then iterating on puzzles using those limited features. Otherwise the player isn't given a change to master each feature. Still, experimenting could help find the most interesting features and then you could choose the top 6-10 and build levels from those

PRs and ideas welcome.

Legal

I have no idea what the legal implications are. AFAICT, Game Mechanics can not be copyrighted but of course I am not a lawyer. Further, the game is 38yrs old so there are certainly no valid patents. And of course, this is just derived. No idea how the original game runs. In any case though, use at your own risk.

LICENSE

The game is MIT, the levels are licensed by their respective creators. The license and the creator detailed in the level file itself. If there is no license in the level file then they are CC-BY.

To be clear, you have my permission to publish a commercial game based on this code but make sure to provide attribution as required and make sure you only include levels that have a compatible license. (CC-BY, CC-BY-ND, CC0)

Also, I'd love to know about it!

You might also like...

This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X and O on a 3x3 grid.

This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X and O on a 3x3 grid.

Tic Tac Toe Game This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X a

Mar 4, 2023

A game inspired by Go, developed using Phaser JS

A game inspired by Go, developed using Phaser JS

Influence A game inspired by Go, developed using Phaser How to play Players take turns to select and color a tile. At the end of a turn, each tile wil

Aug 28, 2022

Free, open source game engine online

microStudio is a free, open source game engine online. It is also a platform to learn and practise programming. microStudio can be used for free at ht

Dec 30, 2022

🚀 📈 Stock market game where the stocks are github repositories

GitHubStonks What is githubstonks ? githubstonks.com Githubstonks is a stock market game where the stocks are popular GitHub repositories. You can buy

Sep 27, 2022

Multiple hacks that breaks the game

blooket-hack All of the cheats are based on a game mode. So if you chose a gold quest game mode then you go to the gold folder and then use one of the

Mar 5, 2022

lifeRestart 游戏魔改之码农搬砖https://juejin.cn/game/coding-life?utm_source=github

Forked from https://github.com/VickScarlet/lifeRestart lifeRestart English | 简体中文 Introduction Game Life Restart Usage Web Version Clone project code.

Nov 20, 2022

Trying to make a game engine apparently.

Clockwork - a game engine from scratch The goal of this project is to build a game engine, I still don't know what it needs to do, but will update thi

Oct 31, 2021

Cardmatchinggamebyercan - A card-matching game made with Flutter.

card_matching_game_by_ercan A card-matching game. Working Demo: https://confident-austin-19dbd2.netlify.app Getting Started This project is a starting

Dec 14, 2022
Comments
  • Use a seeded random?

    Use a seeded random?

    That way you could provide the seed and get the same level? Kind of scary in that if you add anything it will change the outcome. Meaning, adding this would add the responsibility that changing the code and/or adding a new feature does not change what level is generated for a given seed.

    opened by greggman 1
  • Go fullscreen on Android?

    Go fullscreen on Android?

    seem like I don't want to go fullscreen on desktop (though maybe an icon to do it since most users probably don't know they can do it themselves).

    Should I force landscape orientation on android?

    Should I force the game to landscape period? I can't force it landscape on iOS but I can detect if the screen is in landscape or portrait and if portrait then draw the screen rotated 90 degrees to tell users to turn the screen

    enhancement 
    opened by greggman 0
  • Split Screen Multi-Player

    Split Screen Multi-Player

    The code already handles 2 players. The tiler can draw multiple sections of the map. Maybe we could split the screen into N pieces (not sure what if any limit for N)

    enhancement 
    opened by greggman 0
  • Fix Scroll Speed

    Fix Scroll Speed

    Because game runs at 10fps and scroll speed is set to 10% that means for each of the 6 displayed frames of a game frame the screen scrolls at 6 different rates.

    In other words, lets say the screen needs to scroll 32 pixels (one tile)

    It might scroll 32 * 0.1 pixels on frame 1 or 3.2px to position 3.2 Then it would scroll 28.8 * 0.1 pixels on frame 2 to 6.08 Then it would scroll 25.92 * 0.1 pixels on frame 3 to 8.672 As you can see each frame is slower but then jumps up when the player moves further At frame 6 a game frame ticks and now it's target is 64 pixels.

    This stutter is noticeable.

    A simple solution is probably just a max velocity of tilesSize / frameRate

    bug enhancement 
    opened by greggman 0
Owner
Greggman
30 years of games 5 years of Chrome
Greggman
My solutions for CS61A Fall 2020.

CS61A-Fall-2020 My solutions and experience for CS61A Fall 2020. 一、课程介绍 这门课作为Berkeley大一新生的第一门计算机课程,是一门计算机导论的课程,主要的编程语言是python,此外还介绍了LISP的方言Scheme语法和SQ

null 46 Dec 23, 2022
Homework Assignments for Visualization for Data Science, Fall 2022, University of Utah

Homeworks for Utah's Vis for Data Science Course In subfolders in this directory you will find the homeworks for CS 6630 / CS 5630 / DS 4630 – Visuali

Datavis Course 19 Nov 14, 2022
Tutorials for MATH 4432 Statistical Machine Learning, HKUST, Fall 2022

Tutorials for MATH 4432 Statistical Machine Learning Course information MATH 4432 Statistical Machine Learning Instructor: Prof. YANG Can Teaching ass

WANG Zhiwei 7 Dec 1, 2022
About Introduction to Machine Learning for the Arts, IMA, Tisch School of the Arts, New York University, Fall 2022

Introduction to Machine Learning for the Arts About Introduction to Machine Learning for the Arts, IMA, Tisch School of the Arts, New York University,

ml5 9 Nov 4, 2022
This is a project that is in partial fulfillment of our CSCI 318 - Programming Language Concepts class of the Fall 2022 semester in New York Institute of Technology

StreetEasier A hub to search for apartments and roommate matching This project was bootstrapped with Create React App. Want to Test Yourself? 1.) Clon

Kennette James Maddela 3 Dec 5, 2022
NFT Game Starter Project: https://github.com/buildspace/buildspace-nft-game-starter

Running React on Repl.it React is a popular JavaScript library for building user interfaces. Vite is a blazing fast frontend build tool that includes

Zahuis 2 Feb 11, 2022
Conways-game-of-life - A Conway's Game Of Life project using Python

conways-game-of-life A Conway's Game Of Life project using Python JavaScript Devlog January 1st 2022: also need to remember Python's syntax a bit will

Felipe Melgaço Magesty Silveira 0 Sep 23, 2022
Slime jumper game is a simple game that requires you to escape from the enemies that come your way.

Slime Jumper What is this game? The slime jumper game is a game with a simple logic (but it was not so easy to do) where you have to escape from the e

Fatih 2 Mar 1, 2022
Clinton Mbonu 20 Jun 30, 2022
INeedHelp is a Game Boy, Game Boy Advance, and Nintendo DS emulator written in JavaScript and TypeScript.

INeedHelp INeedHelp is a Game Boy Advance and Nintendo DS emulator written in JavaScript/TypeScript. FAQ Why is it called INeedHelp? You would need he

Powerlated 6 Jun 29, 2022