feat(scala): m11 pong capstone (model, rules, view, app) with tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6ecb7c013
commit
f4b671678e
10 files changed
+479
-1
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package snake
|
||||
package pong
|
||||
|
||||
import PongModel.*
|
||||
|
||||
/** m11 pong view: the same Scene shapes as the snake view, so the same drawScene and runtime draw it. */
|
||||
object PongView:
|
||||
|
||||
/**
|
||||
* Describe the match as shapes, drawn in order (all text is "#ffffff", align "center"):
|
||||
* background `Rect(0, 0, 640, 400, "#111111")`; the player paddle `Rect(PLAYER_X*8, player*8, 8, 64, "#ffffff")`,
|
||||
* then the cpu paddle the same way at CPU_X; the ball `Rect(x*8, y*8, 8, 8, "#ffeb3b")`;
|
||||
* the score `Text(320, 30, "<player> <cpu>" (three spaces), size 24)`.
|
||||
* When Over: `Text(320, 200, "You Win!" if the player has more points, else "CPU Wins", size 32)` and
|
||||
* `Text(320, 230, "Press R to restart", size 16)`.
|
||||
*/
|
||||
def pongView(state: PongState): Scene = ???
|
||||
Reference in new issue
Block a user