This website works better with JavaScript.
Home
Explore
Help
Sign In
forestbelton
/
island-story
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Spawn player at map spawn
master
Forest Belton
3 years ago
parent
e2564ecedc
commit
e9b3a49054
1 changed files
with
19 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+19
-0
src/map.s
+ 19
- 0
src/map.s
View File
@ -47,6 +47,25 @@ Map_Load::
ld
d
,
CURRENT_DATA_END
-
CURRENT_DATA_START
call
memcpy
;
Move
player
to
spawn
point
ld
a
,
[
CURRENT_CAMERA_X
]
ld
b
,
a
ld
a
,
[
CURRENT_SPAWN_X
]
sub
b
sla
a
sla
a
sla
a
ld
[
PLAYER_X
],
a
ld
a
,
[
CURRENT_CAMERA_Y
]
ld
b
,
a
ld
a
,
[
CURRENT_SPAWN_Y
]
sub
b
sla
a
sla
a
sla
a
ld
[
PLAYER_Y
],
a
;
Write
tiles
to
VRAM
ld
hl
,
CURRENT_TILE_PTR
ld
a
,
[
hl
+
]
Write
Preview
Loading…
Cancel
Save