study20251107_breakout (mobile-compatible)

This is just a study. This is a breakout clone game (mobile-compatible edition). / ただの習作です。ブロック崩しです(モバイル対応版)。
mouse movement only (or swiping on touch devices)
Learn more about Creative Commons
Join Plus+ to change privacy settings
Join Plus+ to hide source code
  • mySketch
/*
* study20251107_breakout
* written by cleemy desu wayo
* 2025-11-07
* ----
* this version is current as of 2025-11-07 02:30 UTC
*
* ported from this Processing sketch:
* https://gitlab.com/cleemy-desu-wayo/outvoke/-/tree/main/samples/2025/osc_vrchat_processing.pde
*
* The above Processing sketch has an OSC receiving function, but this p5.js edition does not
* have this function.
*
* ----
* Original Processing sketch was written as sample code for a project called Outvoke.
*
* Outvoke project is:
* https://gitlab.com/cleemy-desu-wayo/outvoke
*
*/

const fontName = "Noto Sans Mono"; // change this line appropriately

let frameRateNum = 60;
let gameMode = 0; // 0: before serve 1: normal 2: game over
let controlMode = 0; // 0: mouse 1: OSC
let drawCnt = 0;
let score = 0;
let lastReflectX = -100.0;
let lastReflectY = -100.0;

let initialDeg = 60.0;
let initialSpeed = 3.0;
let nomalReflectSpeed = 6.0;
let specialReflectSpeed = 13.0;

Mode
Select mode or a template
Join Plus+ to code together live.
Centers sketch and matches the background color.
Prevents infinite loops that may freeze the sketch.
This will be the default layout for your sketches
Easy on the eyes
It will show up when there is an error or print() in code
Potential warnings will be displayed as you type
Autocomplete suggestions will be displayed as you type.
Closes parenthesis-like characters automatically as you type
Use ligatures to make your code more readable

  • Controls
    Play
    Ctrl+Enter
  • Code
    Ctrl+Shift+Enter
  • Save
    Ctrl+S
  • Interface
    Fullscreen
    Ctrl+Alt+F
  • Switch Layout
    Ctrl+Alt+L
  • Settings
    Ctrl+Alt+.
  • Editor
    Tidy Code
    Ctrl+B
  • Multiple Cursors
    Ctrl+Click
  • Duplicate Line/Selection
    Ctrl+Shift+D
  • Move Line
    Alt+↑/↓
  • Select Multiple
    Ctrl+D
  • Find in Code
    Ctrl+F
  • Find Next
    Ctrl+G
  • Find Previous
    Ctrl+Shift+G
  • Autocomplete
    Ctrl+I
  • Jump to P5js Refernc.
    Alt+Click
  • Insert Color
    Ctrl+Shift+C

Join Plus+ for private sketches, version history, 1GB space, custom embeds, and more!
🌸 p5.js says: p5 had problems creating the global function "model", possibly because your code is already using that name as a variable. You may want to rename your variable to something else. (https://p5js.org/reference/p5/model)