Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

60%
+1 −0
Sandbox Catch the fruit

posted 4y ago by Razetime‭

#1: Initial revision by user avatar Razetime‭ · 2020-11-14T05:53:59Z (about 4 years ago)
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?