Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 2D platforming

Author
Message
Uppy
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location:
Posted: 20th Sep 2003 20:59
haha yet another noobie question, im thinking i want to make a 2D platformer but not sure actually how to move the sprites (i know how to make/ animate them though) the DB tutorial only tells you how to make the computer move the sprite, any help would be appreciated
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 22nd Sep 2003 08:02
Hope this help

explor[sync on
sync rate 60
set display mode 800,600,16

ink rgb(255,0,0),1
box 1,1,20,20
ink rgb(255,255,255),1
box 2,2,4,4
box 18,2,20,4
get image 1,1,1,20,20
cls

`.................................Platform.........
ink rgb(0,255,0),1
box 1,100,600,110
box 250,260,799,270
box 1,400,500,410
box 1,500,799,510

sprite 1,50+rnd(600),1,1

dropspeed=5
speed=4

`.................................................................
`.
`. Use cursor key to move Spacebar to jump to top
`.
`.................................................................


repeat
`.................................Sprite position..........

sx=sprite x(1)
sy=sprite y(1)

`.................................Get Platform Color........
cpoint=point(sx,sy+sprite height(1)+dropspeed)

`.................................Move The Sprite...........
if leftkey()=1 then x=x-speed
if rightkey()=1 then x=x+speed

`.................................Jump.To Top.............
if spacekey()=1 and cpoint>0
for j=1 to 2
jump=jump-j
sprite 1,50+x,jump,1
sync
next j
drop=0
jump=0
endif

`.................................See if sprite Hit color....
if cpoint=0 then drop=drop+dropspeed

sprite 1,50+x,drop,1

sync
until mouseclick()/code]

You cant do it if you try

Login to post a reply

Server time is: 2024-11-25 08:57:29
Your offset time is: 2024-11-25 08:57:29