|
Post by salamiboy2 on May 15, 2016 13:37:42 GMT -5
elusive, I've looked at your new compiler. It's looking pretty good so far! And yes, I should've used a variable to work with the joypad. It's just that I've been coding since 2013, and I'm used to constantly referring to functions. Hopefully I'll get used to joypad variables.
|
|
|
Post by salamiboy2 on May 15, 2016 3:58:42 GMT -5
Thanks! Here's the code. (sorry if it's buggy)
print " Press Start to begin "
print "------------------------------------"
print "in the game, press start to bring up"
print " the menu. press C to draw tile and "
print " press A to erase tile. "
while joypad().7=0
sleep 1
wend
while joypad().7=1
sleep 1
wend
cls
goto game
game:
dim dxspot as integer
dim dyspot as integer
loadtiles arrow,1,128
loadtiles full,1,129
arrow=addsprite(1,1)
palette &h0A60,0,0
palette &h0EA2,2,1
propsprite arrow,128,0
movesprite arrow,128,128
loop2:
while 1
setgfxplane scroll_b
x=spriteposx(arrow)
y=spriteposy(arrow)
dxspot=x-123/8
dyspot=y-127/8
if joypad().2 then shiftsprite 0,-2,0
if joypad().3 then shiftsprite 0,2,0
if joypad().1 then shiftsprite 0,0,2
if joypad().0 then shiftsprite 0,0,-2
if x<1+128 then shiftsprite 0,2,0
if x>310+128 then shiftsprite 0,-2,0
if y>216+128 then shiftsprite 0,0,-2
if y<1+128 then shiftsprite 0,0,2
if joypad().7 then gosub clear
if joypad().5 then gosub plot
if joypad().6 then gosub erase
sleep 1
wend
' g=(player0y-7)/3
'h=(player0x-10)/4
clear:
ink 1
setgfxplane scroll_a
locate 10,10
print "Press B to clear"
locate 11,10
print "Press A to return"
while 1
if joypad().4 then goto wipe
if joypad().6 then return
wend
wipe:
setgfxplane scroll_b
for y2=0 to 28
for x2=0 to 39
drawtile 0,x2,y2
next x2
next y2
setgfxplane scroll_a
cls
goto loop2
plot:
ink 2
drawtile 129,dxspot,dyspot
return
erase:
ink 2
drawtile 0,dxspot,dyspot
return
arrow:
DATALONG $00011000 ' Tile: 0
DATALONG $00111100
DATALONG $01111110
DATALONG $11111111
DATALONG $00011000
DATALONG $00011000
DATALONG $00011000
DATALONG $00011000
full:
datalong $11111111
datalong $11111111
datalong $11111111
datalong $11111111
datalong $11111111
datalong $11111111
datalong $11111111
datalong $11111111
|
|
|
Post by salamiboy2 on May 14, 2016 14:27:52 GMT -5
Using division, addition and complex math, I was able to make tiles draw based on the co-ordinates of the sprite. As you know, tiles move 8 pixels at a time, and sprites move 1 pixel at a time. This was very difficult to do. Enjoy I guess. Attachments:tiledraw.bin (14.26 KB)
|
|
|
Post by salamiboy2 on Apr 25, 2016 6:14:05 GMT -5
I have everything with my game sorted now. I'll start a new project later on
|
|
|
Post by salamiboy2 on Apr 17, 2016 6:26:26 GMT -5
Okay, I have got another question. I've made scrolling in my game. When it gets to "game over", it seems to center where the scrolling was (if you know what I mean) How do I reset the scrolling? I've tried switching planes and such, but they don't do a damn thing.
|
|
|
Post by salamiboy2 on Apr 17, 2016 4:12:46 GMT -5
YES! It works really well! My picture looks really good now! That's that question sorted out. I'll post here again when I want to know something else. But for now, I'll carry on with my game
|
|
|
Post by salamiboy2 on Apr 16, 2016 11:13:58 GMT -5
I've totally forgotten how to draw image maps. Please read the documentation / search the forum / check the examples Thanks, but since my tilemaps are in DATAINT mode they come looking like rubbish:
|
|
|
Post by salamiboy2 on Apr 16, 2016 9:34:00 GMT -5
Hey. I used to be quite skilled at BasiEgaXorz (when I was acting stupid as beginnerxorz) but having not used it in a while some of the stuff I used to know just vanished. POOF! So finally I've taken your suggestions. I'm now posting all my questions in this one thread to save space.
First of all, I've totally forgotten how to draw image maps. I want to do it, so there won't be tons of black tiles in the file that take up 1/2 the space. Thanx.
|
|