Skip to content

Commit

Permalink
GBCompo demo v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEd2 committed Sep 25, 2021
1 parent 1440762 commit 6e1813a
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 35 deletions.
1 change: 1 addition & 0 deletions Defines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ sys_ResetTimer: db
sys_CurrentFrame: db ; incremented each frame, used for timing
sys_btnPress: db ; buttons pressed this frame
sys_btnHold: db ; buttons held
sys_btnRelease: db ; buttons released this frame

sys_VBlankFlag: db
sys_LCDCFlag: db
Expand Down
7 changes: 3 additions & 4 deletions Engine/Object.asm
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,9 @@ Collectable_ExtraLife:

; INPUT: de = animation pointer for death animation
Monster_CheckKill:
ld a,[sys_btnHold]
bit btnA,a ; is A held?
jr nz,.dokill
jp KillPlayer
ld a,[Player_YVelocity]
bit 7,a ; is player falling?
jp nz,KillPlayer

.dokill
; check if player has killed an enemy this frame
Expand Down
17 changes: 16 additions & 1 deletion Engine/Player.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bPlayerIsUnderwater = 1
bPlayerIsDead = 2
bPlayerVictory = 3
bPlayerHitEnemy = 4
bPlayerUnused5 = 5
bPlayerBounceCancel = 5
bPlayerUnused6 = 6
bPlayerDirection = 7

Expand Down Expand Up @@ -138,6 +138,7 @@ ProcessPlayer:
bit bPlayerIsDead,a
jr z,.notdead
ld a,[Player_YVelocity]
bit 7,a ; is player falling?
jp nz,.moveair2
Expand All @@ -152,6 +153,20 @@ ProcessPlayer:
jp z,Player_Respawn
jp .moveair2
.notdead
ld a,[sys_btnRelease]
bit btnA,a
jr z,:+
ld a,[Player_YVelocity]
bit 7,a
jr z,:+
scf
rra
ld [Player_YVelocity],a
ld a,[Player_YVelocityS]
rra
ld [Player_YVelocityS],a
:
lb bc,0,1
ld a,[sys_btnHold]
bit btnLeft,a
Expand Down
Binary file modified GFX/Sprites/Fish.2bpp
Binary file not shown.
2 changes: 1 addition & 1 deletion Levels/Plains3.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"map":{"tile_w":16,"tile_h":16,"tile_spacing":0,"image_filename":"../GFX/PlainsTileset.png","animations":[],"tags":[],"w":64,"h":32,"data":[18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,10,18,38,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,24,0,0,0,10,18,37,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,0,2,3,3,4,0,0,0,10,18,19,38,19,20,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,38,19,20,0,0,0,10,18,19,19,37,20,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,23,0,0,0,0,18,19,19,20,0,0,0,10,18,19,19,37,20,0,0,0,0,24,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,23,24,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,4,0,0,0,18,19,19,20,0,0,0,10,18,37,19,38,20,0,0,0,0,2,3,3,4,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,19,37,20,0,0,0,18,19,19,20,0,0,0,0,34,35,35,35,36,0,0,0,0,18,19,19,20,18,20,0,0,0,0,10,10,10,10,0,0,0,0,0,18,19,19,19,19,19,20,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,19,37,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,25,0,18,38,19,20,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,37,19,20,0,24,8,0,0,0,0,0,0,25,0,18,19,38,38,38,19,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,2,3,22,19,19,20,18,20,0,0,0,0,0,0,0,0,0,0,2,3,3,22,19,37,38,38,19,21,3,3,4,10,10,10,10,10,2,3,3,22,19,19,37,37,38,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,37,20,18,20,24,24,0,0,0,0,0,0,0,24,18,19,38,19,37,19,19,19,19,38,19,19,20,10,10,10,10,10,18,19,19,37,19,19,19,37,19,20,0,0,0,18,19,19,20,0,0,0,24,0,0,0,0,24,0,25,18,37,19,19,37,20,18,21,3,3,3,3,3,3,3,3,3,3,22,19,19,19,19,19,19,19,38,19,19,19,21,3,3,3,3,3,22,19,19,37,19,19,19,37,37,20,13,13,13,18,19,19,21,3,3,3,3,3,3,3,3,3,3,3,22,19,19,37,19,20,18,19,19,19,19,19,19,19,37,19,19,37,19,37,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,38,19,19,19,19,37,37,19,19,19,21,3,3,3,22,38,19,19,19,38,19,19,38,19,19,19,19,38,37,19,19,19,38,19,20,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"objects":[{"name":"LevelProperties","Tileset":"Tileset_Plains","Music":"MUS_PLAINS","Background":"BG_Test","Palette":"Pal_Plains","x":"32","y":"16"},{"name":"PlayerStart","x":"32","y":"208","w":"16","h":"16"},{"name":"MONSTER_TEST2","x":"336","y":"128","w":"16","h":"16","id":"$3"},{"name":"MONSTER_TEST2","x":"464","y":"208","w":"16","h":"16","id":"$4"},{"name":"MONSTER_TEST2","x":"624","y":"96","w":"16","h":"16","id":"$5"},{"name":"MONSTER_TEST2","x":"928","y":"160","w":"16","h":"16","id":"$6"},{"name":"COLLECTABLE_1UP","id":"$7","x":"896","y":"0","w":"16","h":"16"}]}
{"map":{"tile_w":16,"tile_h":16,"tile_spacing":0,"image_filename":"../GFX/PlainsTileset.png","animations":[],"tags":[],"w":64,"h":32,"data":[18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,10,18,19,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,10,18,38,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,24,0,0,0,10,18,37,19,19,20,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,0,2,3,3,4,0,0,0,10,18,19,38,19,20,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,38,19,20,0,0,0,10,18,19,19,37,20,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,23,0,0,0,0,18,19,19,20,0,0,0,10,18,19,19,37,20,0,0,0,0,24,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,23,24,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,4,0,0,0,18,19,19,20,0,0,0,10,18,37,19,38,20,0,0,0,0,2,3,3,4,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,19,37,20,0,0,0,18,19,19,20,0,0,0,0,34,35,35,35,36,0,0,0,0,18,19,19,20,18,20,0,0,0,0,10,10,10,10,0,0,0,0,0,18,19,19,19,19,19,20,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,19,37,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,25,0,18,38,19,20,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,37,19,20,0,24,0,0,0,0,0,0,0,25,0,18,19,38,38,38,19,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,2,3,22,19,19,20,18,20,0,0,0,0,0,0,0,0,0,0,2,3,3,22,19,37,38,38,19,21,3,3,4,10,10,10,10,10,2,3,3,22,19,19,37,37,38,20,0,0,0,18,19,19,20,0,0,0,0,0,0,0,0,0,0,0,18,19,19,19,37,20,18,20,24,24,0,0,0,0,0,0,0,24,18,19,38,19,37,19,19,19,19,38,19,19,20,10,10,10,10,10,18,19,19,37,19,19,19,37,19,20,0,0,0,18,19,19,20,0,0,0,24,0,0,0,0,24,0,25,18,37,19,19,37,20,18,21,3,3,3,3,3,3,3,3,3,3,22,19,19,19,19,19,19,19,38,19,19,19,21,3,3,3,3,3,22,19,19,37,19,19,19,37,37,20,13,13,13,18,19,19,21,3,3,3,3,3,3,3,3,3,3,3,22,19,19,37,19,20,18,19,19,19,19,19,19,19,37,19,19,37,19,37,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,38,19,19,19,19,37,37,19,19,19,21,3,3,3,22,38,19,19,19,38,19,19,38,19,19,19,19,38,37,19,19,19,38,19,20,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"objects":[{"name":"LevelProperties","Tileset":"Tileset_Plains","Music":"MUS_PLAINS","Background":"BG_Test","Palette":"Pal_Plains","x":"32","y":"16"},{"name":"PlayerStart","x":"32","y":"208","w":"16","h":"16"},{"name":"MONSTER_TEST2","x":"336","y":"128","w":"16","h":"16","id":"$3"},{"name":"MONSTER_TEST2","x":"464","y":"208","w":"16","h":"16","id":"$4"},{"name":"MONSTER_TEST2","x":"624","y":"96","w":"16","h":"16","id":"$5"},{"name":"MONSTER_TEST2","x":"928","y":"160","w":"16","h":"16","id":"$6"},{"name":"COLLECTABLE_1UP","id":"$7","x":"896","y":"0","w":"16","h":"16"}]}
2 changes: 1 addition & 1 deletion Levels/Plains6.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6e1813a

Please sign in to comment.