Skip to content

Commit 7575b68

Browse files
committed
test2 splash and config screens
1 parent 752c6e6 commit 7575b68

File tree

8 files changed

+496
-39
lines changed

8 files changed

+496
-39
lines changed

.github/makecode/blocks.png

50.3 KB
Loading

.github/makecode/blocksdiff.png

-254 KB
Loading

images.g.jres

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

images.g.ts

Lines changed: 246 additions & 0 deletions
Large diffs are not rendered by default.

main.blocks

Lines changed: 122 additions & 1 deletion
Large diffs are not rendered by default.

main.ts

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,6 @@ function defineTileMapBorder () {
184184
14
185185
]
186186
}
187-
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
188-
bomb = sprites.create(assets.image`floor02`, SpriteKind.Bomb)
189-
bomb.setPosition(player1.x, player1.y)
190-
animation.runImageAnimation(
191-
bomb,
192-
assets.animation`bomb`,
193-
200,
194-
true
195-
)
196-
})
197187
controller.anyButton.onEvent(ControllerButtonEvent.Released, function () {
198188
animation.stopAnimation(animation.AnimationTypes.All, player1)
199189
})
@@ -279,41 +269,75 @@ function createTileMap () {
279269
}
280270
}
281271
}
272+
let bomb: Sprite = null
282273
let rowsTileMap = 0
283274
let columnsTileMap = 0
284275
let indexTileMap = 0
276+
let depthMiddle = 0
285277
let indexTempBorder = 0
286278
let indexBorder = 0
287-
let bomb: Sprite = null
288279
let borderYLocations: number[] = []
289280
let borderXLocations: number[] = []
290-
let Comments = ""
281+
let player1: Sprite = null
291282
let widthWall = 0
292283
let depthFront = 0
293-
let depthMiddle = 0
294284
let depthBack = 0
295-
let player1: Sprite = null
296-
let gameTitle = ["", "DYNABOMBER"]
297-
let gameOptions = ["Arrows = Move ", "Button A = Bomb ", "Button B = Select", ""]
298-
let gameSubtitle = ["by", "Espora.net"]
299-
let mySplashScreen = infoScreens.createSplashScreen()
300-
mySplashScreen.setTitles(gameTitle)
301-
mySplashScreen.addHeadlines(gameSubtitle)
302-
mySplashScreen.addInstructionsList(gameOptions)
303-
mySplashScreen.build()
304-
pause(5000)
305-
mySplashScreen.release()
306-
tiles.setTilemap(tilemap`level-1`)
307-
player1 = sprites.create(assets.image`player1-start`, SpriteKind.Player)
308-
player1.z = 100
309-
player1.setPosition(16, 16)
310-
controller.moveSprite(player1)
311-
scene.cameraFollowSprite(player1)
312-
depthBack = 80
313-
depthMiddle = 100
314-
depthFront = 120
315-
widthWall = 12
316-
player1.z = depthMiddle
317-
defineTileMapBorder()
318-
createTileMapBorder()
319-
createTileMap()
285+
let Comments = ""
286+
Comments = "SCREENS: 0 = SPLASH, 1 = SETTINGS, 2=> LEVELS"
287+
let screen2 = 0
288+
let gameTheme = ""
289+
forever(function () {
290+
Comments = "DEFINE SPLASH, SETTINGS SCREENS AND GAME LEVELS"
291+
Comments = "SCREENS: 0 = SPLASH, 1 = SETTINGS, 2=> LEVELS"
292+
if (screen2 == 0) {
293+
scene.setBackgroundImage(assets.image`splashScreen`)
294+
pause(3000)
295+
screen2 = 1
296+
}
297+
if (screen2 == 1) {
298+
scene.setBackgroundImage(assets.image`configScreen`)
299+
if (controller.A.isPressed()) {
300+
gameTheme = "Forest"
301+
screen2 = 2
302+
}
303+
if (controller.B.isPressed()) {
304+
gameTheme = "City"
305+
screen2 = 2
306+
}
307+
}
308+
if (screen2 == 2) {
309+
if (gameTheme == "Forest") {
310+
tiles.setTilemap(tilemap`level-1`)
311+
}
312+
if (gameTheme == "City") {
313+
tiles.setTilemap(tilemap`level-1`)
314+
}
315+
player1 = sprites.create(assets.image`player1-start`, SpriteKind.Player)
316+
player1.z = 100
317+
player1.setPosition(16, 16)
318+
controller.moveSprite(player1)
319+
scene.cameraFollowSprite(player1)
320+
depthBack = 80
321+
depthMiddle = 100
322+
depthFront = 120
323+
widthWall = 12
324+
player1.z = depthMiddle
325+
defineTileMapBorder()
326+
createTileMapBorder()
327+
createTileMap()
328+
pause(1000)
329+
screen2 = 3
330+
}
331+
})
332+
forever(function () {
333+
if (controller.A.isPressed() && screen2 == 3) {
334+
bomb = sprites.create(assets.image`floor02`, SpriteKind.Bomb)
335+
bomb.setPosition(player1.x, player1.y)
336+
animation.runImageAnimation(
337+
bomb,
338+
assets.animation`bomb`,
339+
200,
340+
true
341+
)
342+
}
343+
})

tilemap.g.jres

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@
3838
],
3939
"displayName": "level-1"
4040
},
41+
"level2": {
42+
"id": "level2",
43+
"mimeType": "application/mkcd-tilemap",
44+
"data": "MTAxMDAwMTAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM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AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA==",
54+
"tileset": [
55+
"myTiles.transparency16"
56+
],
57+
"displayName": "level3"
58+
},
4159
"*": {
4260
"mimeType": "image/x-mkcd-f4",
4361
"dataEncoding": "base64",

tilemap.g.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,44 @@ namespace myTiles {
3131
. . . . . . . . . . . . . . .
3232
. . . . . . . . . . . . . . .
3333
`, [myTiles.transparency16,myTiles.tile1], TileScale.Sixteen);
34+
case "level2":
35+
case "level2":return tiles.createTilemap(hex`1000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`, img`
36+
. . . . . . . . . . . . . . . .
37+
. . . . . . . . . . . . . . . .
38+
. . . . . . . . . . . . . . . .
39+
. . . . . . . . . . . . . . . .
40+
. . . . . . . . . . . . . . . .
41+
. . . . . . . . . . . . . . . .
42+
. . . . . . . . . . . . . . . .
43+
. . . . . . . . . . . . . . . .
44+
. . . . . . . . . . . . . . . .
45+
. . . . . . . . . . . . . . . .
46+
. . . . . . . . . . . . . . . .
47+
. . . . . . . . . . . . . . . .
48+
. . . . . . . . . . . . . . . .
49+
. . . . . . . . . . . . . . . .
50+
. . . . . . . . . . . . . . . .
51+
. . . . . . . . . . . . . . . .
52+
`, [myTiles.transparency16], TileScale.Sixteen);
53+
case "level3":
54+
case "level3":return tiles.createTilemap(hex`1000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`, img`
55+
. . . . . . . . . . . . . . . .
56+
. . . . . . . . . . . . . . . .
57+
. . . . . . . . . . . . . . . .
58+
. . . . . . . . . . . . . . . .
59+
. . . . . . . . . . . . . . . .
60+
. . . . . . . . . . . . . . . .
61+
. . . . . . . . . . . . . . . .
62+
. . . . . . . . . . . . . . . .
63+
. . . . . . . . . . . . . . . .
64+
. . . . . . . . . . . . . . . .
65+
. . . . . . . . . . . . . . . .
66+
. . . . . . . . . . . . . . . .
67+
. . . . . . . . . . . . . . . .
68+
. . . . . . . . . . . . . . . .
69+
. . . . . . . . . . . . . . . .
70+
. . . . . . . . . . . . . . . .
71+
`, [myTiles.transparency16], TileScale.Sixteen);
3472
}
3573
return null;
3674
})

0 commit comments

Comments
 (0)