Author Topic: Wee Basic 0.4 - with sprites and backgrounds  (Read 7459 times)

0 Members and 1 Guest are viewing this topic.

Offline marovada

  • Newbie
  • *
  • Posts: 10
Wee Basic 0.4 - with sprites and backgrounds
« on: March 19, 2008, 01:29:27 PM »
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.

Version 0.4

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:

- 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)

Competition details

Project name : Wee Basic
From : Sydney, Australia
Division : NDS APP
Original enter : yes
Support Motion : only if have time - not yet
In last NEO Compo this project have won in the top 10 :no
Project description: A BASIC interpreter for the NDS - programming and debugging are performed on the DS

Edit: more information on Wee Basic can be found on my website:
http://freescifistories.wordpress.com/

and on the forum:
http://z3.invisionfree.com/Wee_Basic/index.php?act=idx
« Last Edit: March 20, 2008, 04:57:32 AM by marovada »

Offline marovada

  • Newbie
  • *
  • Posts: 10
Re: Wee Basic 0.4 - with sprites and backgrounds
« Reply #1 on: March 22, 2008, 05:04:20 PM »
I've uploaded a tic tac toe demo program to my site to demonstrate most of the Wee Basic language:
http://freescifistories.wordpress.com/2008/03/22/wee-tic-tac-toe-demo/

Offline marovada

  • Newbie
  • *
  • Posts: 10
Re: Wee Basic 0.4 - with sprites and backgrounds
« Reply #2 on: March 22, 2008, 05:11:16 PM »
Goomek on my site pointed out that I forgot the demo.txt with Wee Basic.  Sorry, 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


Offline marovada

  • Newbie
  • *
  • Posts: 10
Re: Wee Basic 0.4 - with sprites and backgrounds
« Reply #3 on: March 29, 2008, 07:53:21 AM »
If you are getting errors with the demo program, see my post in this topic:
http://www.neoflash.com/forum/index.php/topic,5039.0.html