Wee Basic – Now with Sprites and Backgrounds

Yes, you heard it. Wee Basic now allows the use of sprites and backgrounds so you can try your hand with real Nintendo DS games using simple BASIC.

running.jpg

weeneo.jpg

I’ve even entered Wee Basic for the first time in the NeoFlash summer coding competition: http://www.neoflash.com/forum/index.php/topic,4951.0.html

Version 0.4

Download: wee04.ppt

To use the demo program,put Wee and all of the gif files and demo.txt into the root directory of your card.
Then load the demo in Wee Basic, press A or start to run and enjoy!
Don’t forget to DLDI patch Wee for your card.

Fixed:

– bugs with nested ifs

added/changed

– neo splash screen
– sprites on both screens (must be gif files)
– backgrounds on both screens (must be gif files)
– can uses start or A to start a program running
– new commands:

loadspr number,screen,x,y,,width,height,file name (creates a sprite specified by the file name on the screen specified at the specified coordinates)
movspr number, screen, x,y (moves an existing sprite specified by the number to new coordinates x and Y on the screen)
delspr number, screen (deletes the specified sprite)
backgr screen, file name (creates a background on the specified screen with the gif file specified by the file name)

Notes:

– file names must be valid gif files and you must specify the full file name
– gif files must be kept in the root directory of your card
– don’t try to move or delete sprites that you haven’t created
– each screen has its own numbered sprites, so you can specify the number 1 for a sprite on the top and bottom screens but don’t specify the same number for sprites on the same screen

(Look at the demo program for examples)

As always, when you download the file, change the extension from PPT to ZIP.

Edit: As Goomek pointed out in the comments, I forgot the demo program.  Here it is (just copy and paste into a text file):

let soldier=1
let bottom=0
let top=1
let keya=202
let keyb=203
let right=205
let left=204
let soldx=5
let soldy=95

cls 1
keyhide
cls 0

gosub topback:
gosub botback:
gosub soldspr:

lab start:

let k=0
let k=key()

if k=keyb
gosub jump:
endif

if k=keya
goto finish:
endif
if k=right or k=left
gosub movsold:
endif

goto start:

lab finish:
end

sub key:
let k=0
while k=0
let k=key()
wend
return

sub topback:
backgr top,”island.gif”
return

sub botback:
backgr bottom,”lake.gif”
return

sub soldspr:
createspr soldier,bottom,
soldx,soldy,32,64,
“soldier.gif”
return

sub movsold:
if k=right
let soldx=soldx+20
movspr soldier,bottom,
soldx,soldy
endif
if k=left
let soldx=soldx-20
movspr soldier,bottom,
soldx,soldy
endif
return

sub jump:
for i=1 to 4
let soldy=soldy-20
movspr soldier,bottom,
soldx,soldy
gosub delay:
next
for i=1 to 4
let soldy=soldy+20
movspr soldier,bottom,
soldx,soldy
gosub delay:
next
return

sub delay:
for j=1 to 10
next
return

Advertisements

5 thoughts on “Wee Basic – Now with Sprites and Backgrounds

  1. Goomek you are right. How embarrassing. I’ll add it to the post as in-line text that you can copy into a file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s