Skip to content

Commit 480e84a

Browse files
committed
Draw more shapes
1 parent 6b68d61 commit 480e84a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/nico/src/nico/mars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export function initMars ({ state, ctx, sprites, clear, tilemap, flags, language
44

55
const marsState = {}
66

7-
const mars = { state: marsState }
7+
const mars = {}
8+
9+
mars.state = marsState
810

911
const tilemapCanvas = document.createElement('canvas')
1012
const tilemapCtx = tilemapCanvas.getContext('2d')

src/nico/src/nico/pureMars.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ function drawShape (mars, loc, value) {
7575
switch (shape.type) {
7676
case 'rect':
7777
mars.rect(shape.x.value, shape.y.value, shape.w.value, shape.h.value)
78+
break
79+
case 'point':
80+
mars.point(shape.x.value, shape.y.value)
81+
break
82+
case 'sprite':
83+
mars.sprite(shape.i.value, shape.x.value, shape.y.value)
84+
break
85+
case 'line':
86+
mars.line(shape.x.value, shape.y.value, shape.x1.value, shape.y1.value)
87+
break
88+
case 'text':
89+
mars.text(shape.text.value, shape.x.value, shape.y.value)
90+
break
91+
case 'tilemap':
92+
mars.tilemap()
93+
break
7894
}
7995
break
8096
case 'none':

0 commit comments

Comments
 (0)