This isn't about you request, but since this is the 2D forum and its your 2D Sprite tutorial that I'm using, I figure going off this threads topic is justifyable.
okay, here is my problem. I am making a 2d platform game and I used your tutorial for tile-/platform-based collision. First, I can't get it to detect x collision like you said in the tutorial. Also, when the character gets to the edge of another platform, even if its like 64 pixels above the character's X position, the character will move to the platform... I was wondering if you could help me on these few aspects...
here is the code:
`Test Megaman like game
Sync on
Sync rate 30
load image "grass.bmp",1
load image "mage_move[1].bmp",2
load image "mage_move[2].bmp",3
load image "mage_jump.bmp",4
dim tile(20,15)
dim platform(50)
for a=0 to 19
tile(a,14)=1
paste image tile(a,14),a*32,14*32
next a
platform(1)=7
platform(2)=8
get image platform(1),0,14*32,(19*32)+32,(14*32+32)
get image platform(2),0,14*32,(3*32)+32,(14*32+32)
sprite 1,0,14*32,platform(1)
sprite 2,5*32,13*32,platform(2)
sprite 3,9*32,12*32-5,platform(2)
maxplatforms=3
dim mage(5)
mage(1)=2
mage(2)=3
mage(3)=4
magesprite=5
sprite magesprite,2,13*32,mage(1)
frame=1
player_x=2
player_y=13*32
cls
do
inc player_y,2
old_x=player_x
sprite magesprite,player_x,player_y,mage(frame)
if jumping=0
for a = 1 to maxplatforms
if sprite x(magesprite)+sprite width(magesprite) => sprite x(a) and sprite x(magesprite)=< sprite x(a)+sprite width(a)
if sprite y(magesprite)+sprite height(magesprite) > sprite y(a)
sprite magesprite, sprite x(magesprite), sprite y(a) - sprite height(magesprite),mage(frame)
jumping=0
endif
endif
next a
if leftkey()=1
if sprite mirrored(magesprite)=1 then mirror sprite magesprite
if frame=1
frame=2
else
frame=1
endif
dec player_x,5
endif
if rightkey()=1
if sprite mirrored(magesprite)=0 then mirror sprite magesprite
if frame=1
frame=2
else
frame=1
endif
inc player_x,5
endif
endif
If upkey()=1 and jumping = 0
jumping = 1
jump_angle = 0
jump_height = sprite y(magesprite)
endif
If jumping = 1
inc jump_angle,4
sprite magesprite, sprite x(magesprite), jump_height - sin(jump_angle)*40, sprite image(magesprite)
for a = 1 to maxplatforms
if sprite x(magesprite)+sprite width(magesprite) => sprite x(a) and sprite x(magesprite)=< sprite x(a)+sprite width(a)
if sprite y(magesprite)+sprite height(magesprite) > sprite y(a)
sprite magesprite, sprite x(magesprite), sprite y(a) - sprite height(magesprite),mage(frame)
jumping=0
endif
endif
next a
if leftkey()=1
if sprite mirrored(magesprite)=1 then mirror sprite magesprite
if frame=1
frame=2
else
frame=1
endif
dec player_x,3
endif
if rightkey()=1
if sprite mirrored(magesprite)=0 then mirror sprite magesprite
if frame=1
frame=2
else
frame=1
endif
inc player_x,3
endif
endif
sync
loop
end
If you could help, that'd be much apreciated.
Dragael Software
Current Project: Nothing worth mentioning