Post History
Sandbox
Catch the fruit
#1: Initial revision
Catch the fruit
Implement a osu!catch style game. # Introduction osu!catch is a rhythm game where the player moves a "basket" to catch "fruits" falling from the top of the screen to the beat of a song. Think pong, but with timing. It is **highly** recommended to [watch this video](https://youtu.be/6WKZE2HPOK8?t=43) before reading the question. Here's a gameplay example from Bubbler: [[osu!catch] Hitsuji to Ojisan - XENO [Spec's Overdose]](https://www.youtube.com/watch?v=zLsPCHzakK8&ab_channel=WoosukKwak) # Input You are required to take the following inputs: * Time: How long your program is supposed to run. * Approach Rate: This is the speed at which the "fruits" are supposed to fall down. * Beatmap: An array of [time, x position, value] triplets where: * Time: you must support time in seconds, at the very least. Higher precision is encouraged. * X position: Where it will fall from. * Value: The size of the "fruit" will decrease with it's value. # Gameplay ## Play area * The canvas must be in a 4:3 aspect ratio. * The score must be displayed at the top of the screen, in the middle. You do not need to align it. * The score starts at 0. * Use a dark background(#222222, preferably). ## The player * The player must be of a rectangular shape, white in color. * Height: 1/50 of canvas height, Width: 1/6 of canvas width. * The player must be at the bottom of the screen, movable using any two keys of your choice. * The player must have a "dash" button. Their speed must increase by a set amount when they hold the dash button. * When the player collects a fruit, it must disappear, and it's value must be added to the score. * When the player misses a fruit, there should be an indicative visual cue where the fruit fell.(a small red square, preferably) ## Fruits * Fruit must be square in shape, and red in color. * Fruits must fall from the top of the screen, outside the viewport(unless unsupported). * Max fruit size is 0.1 × height. Size scales inversely with value. * Fruit speed must be related to the approach rate i.e. Higher approach rate must make the fruits fall faster. You may do this however you like, but please be reasonable. * The lower edge of the fruit must touch the bottom of the screen at it's time value. # Scoring This is code-golf. Shortest answer in each language wins. --- # Meta * Is the specification simple enough? * I am planning on making a separate [tag:ascii-art] challenge for this. Would that be a better idea? * Is the specfication clear? * Any further feedback?