LeafCat79 commited on
Commit
fc84d4c
·
verified ·
1 Parent(s): 75b10ac

Start generation form without sample prompts

Browse files
Files changed (1) hide show
  1. app.py +3 -95
app.py CHANGED
@@ -28,101 +28,9 @@ except Exception:
28
  hf_spaces = None
29
 
30
 
31
- STARTER_HTML = """<!DOCTYPE html>
32
- <html>
33
- <head>
34
- <meta charset="UTF-8" />
35
- <title>Mini Forest Game</title>
36
- <style>
37
- body { margin: 0; background: #111; display: grid; place-items: center; min-height: 100vh; }
38
- canvas { border: 2px solid #222; background: #222; image-rendering: pixelated; }
39
- </style>
40
- </head>
41
- <body>
42
- <canvas id="gameCanvas" width="800" height="450"></canvas>
43
- <script>
44
- const canvas = document.getElementById("gameCanvas");
45
- const ctx = canvas.getContext("2d");
46
-
47
- const background = new Image();
48
- background.src = "sprite_forest_clearing.png";
49
- const playerImg = new Image();
50
- playerImg.src = "sprite_forest_adventurer.png";
51
-
52
- const keys = new Set();
53
- const player = { x: 380, y: 205, w: 48, h: 48, speed: 4 };
54
-
55
- window.addEventListener("keydown", e => keys.add(e.key));
56
- window.addEventListener("keyup", e => keys.delete(e.key));
57
-
58
- function update() {
59
- if (keys.has("a") || keys.has("ArrowLeft")) player.x -= player.speed;
60
- if (keys.has("d") || keys.has("ArrowRight")) player.x += player.speed;
61
- if (keys.has("w") || keys.has("ArrowUp")) player.y -= player.speed;
62
- if (keys.has("s") || keys.has("ArrowDown")) player.y += player.speed;
63
- player.x = Math.max(0, Math.min(canvas.width - player.w, player.x));
64
- player.y = Math.max(0, Math.min(canvas.height - player.h, player.y));
65
- }
66
-
67
- function draw() {
68
- ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
69
- ctx.drawImage(playerImg, player.x, player.y, player.w, player.h);
70
- ctx.fillStyle = "white";
71
- ctx.font = "18px sans-serif";
72
- ctx.fillText("Use WASD or arrow keys", 18, 28);
73
- }
74
-
75
- function loop() {
76
- update();
77
- draw();
78
- requestAnimationFrame(loop);
79
- }
80
- loop();
81
- </script>
82
- </body>
83
- </html>"""
84
-
85
-
86
- DEFAULT_ROLES = """{
87
- "assets": [
88
- {
89
- "id": "forest_adventurer",
90
- "description": "top-down pixel-art adventurer with a bright readable silhouette",
91
- "quantity": 1,
92
- "width": 128,
93
- "height": 128,
94
- "transparent": true,
95
- "composition": "single_subject",
96
- "camera": "top-down"
97
- },
98
- {
99
- "id": "forest_clearing",
100
- "description": "enchanted forest clearing with soft moonlight and readable traversal space",
101
- "quantity": 1,
102
- "width": 800,
103
- "height": 450,
104
- "transparent": false,
105
- "composition": "full_frame",
106
- "camera": "top-down"
107
- }
108
- ]
109
- }"""
110
-
111
- ROLE_PLACEHOLDER = """{
112
- "assets": [
113
- {
114
- "id": "asset_name_used_by_game_code",
115
- "description": "Describe exactly what should be generated",
116
- "quantity": 1,
117
- "width": 256,
118
- "height": 256,
119
- "transparent": true,
120
- "composition": "single_subject",
121
- "camera": "top-down",
122
- "variations": "Optional instructions that distinguish multiple outputs"
123
- }
124
- ]
125
- }"""
126
 
127
 
128
  @dataclass
 
28
  hf_spaces = None
29
 
30
 
31
+ STARTER_HTML = ""
32
+ DEFAULT_ROLES = ""
33
+ ROLE_PLACEHOLDER = "Add asset definitions as JSON, or use one `name: description` line per asset."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
 
36
  @dataclass