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.

Code Snippets / 8 way 2d scrolling

Author
Message
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 23rd Dec 2002 23:19
this litle example show a basic 8 way 2d scrolling map.
most people can't figure this out so I ripped this from a rpg game I made.
have fun all and merry christmas

set display mode 640,480,16
SYNC ON
SYNC RATE 40

set sprite 1,1,1
for x= 1 to 9
set sprite x+1,0,0
next x

for x=0 to 15
for y=0 to 11
line x*40,y*40,x*40+639,y*40
line x*40,y*40,x*40,y*40+479
next y
next x
set text font "times new roman"
set text size 48
print "This is just a sample bitmap"
get image 100,0,0,639,479
SET SPRITE PRIORITY 1,1

cls
for x=1 to 40
circle 50,50,x
next x
get image 1,0,0,100,100

SYNC ON
SYNC RATE 60

x=0
bx=0
by=0

DO
if leftkey()
bx=bx+2
if bx > 639 then bx = 0
endif

if rightkey()
bx=bx-2
if bx 479 then by = 0
endif

if downkey()
by = by - 2
if by
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 24th Dec 2002 01:15
It didn't all come out. I've tried to make a Zelda style rpg, where when you get to the edge of a screen it scrolls to the next one, but at the moment there's just a big jump.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 24th Dec 2002 07:18
my code button doesn't work so i'll copy and paste again.
just in case this doesn't work i'll url my web page, I just started it so it's a rough looking site.
http://www.angelfire.com/rnb/closetoperfect

set display mode 640,480,16
SYNC ON
SYNC RATE 40

set sprite 1,1,1
for x= 1 to 9
set sprite x+1,0,0
next x

for x=0 to 15
for y=0 to 11
line x*40,y*40,x*40+639,y*40
line x*40,y*40,x*40,y*40+479
next y
next x
set text font "times new roman"
set text size 48
print "This is just a sample bitmap"
get image 100,0,0,639,479
SET SPRITE PRIORITY 1,1

cls
for x=1 to 40
circle 50,50,x
next x
get image 1,0,0,100,100

SYNC ON
SYNC RATE 60

x=0
bx=0
by=0

DO
if leftkey()
bx=bx+2
if bx > 639 then bx = 0
endif

if rightkey()
bx=bx-2
if bx < -639 then bx=0
endif

if upkey()
by=by+2
if by >479 then by = 0
endif

if downkey()
by = by - 2
if by < -479 then by = 0
endif

sprite 1,220,140,1

sprite 2,640+bx,by,100
sprite 3,bx,by,100
sprite 4,bx-640,by,100

sprite 5,640+bx,by+480,100
sprite 6,bx,by+480,100
sprite 7,bx-640,by+480,100

sprite 8,640+bx,by-480,100
sprite 9,bx,by-480,100
sprite 10,bx-640,by-480,100

sync
LOOP

Login to post a reply

Server time is: 2024-04-19 17:03:39
Your offset time is: 2024-04-19 17:03:39