DSLua Community
Welcome, Guest. Please login or register.
May 18, 2012, 10:20:32 PM
1371 Posts in 262 Topics by 33109 Members
Latest Member: Limewire Download
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Home-brew/Hacks/Games/Projects  |  Out of the gate and running! « previous next »
Pages: [1]
Author Topic: Out of the gate and running!  (Read 2279 times)
sylus101
Waxing Crescent
**
Posts: 68



« on: March 03, 2007, 07:21:02 PM »

Hello to all!

I have to say folks, DSLua was EXACTLY what I needed. Good Lord... if I had to pick up C/C++ to get anything on my DS screen I'd have probably given up.

http://server1.yellowdns.com/~sylus101/knight.nds
http://server1.yellowdns.com/~sylus101/knight.ds.gba
http://server1.yellowdns.com/~sylus101/knight.lua
Here's my 4th or 5th test seeing what I can do. It's not much, but I'm getting the hang of things fast. I'm DYING to try playing something on my actual DS and not an emulator, but till DLDI is implemented, I'm stuck. These are GBFS versions, you can see my messy code if you'd like too.

The knight can move left and right, kinda walks but doesn't change direction of facing, yet. He's made up of 4 sprites. You can press the attack button with the stylus, though it's just playing a simple test sprite instead of the animation I want it to... that'll come later.

Question as well, if I may. I might have missed it in the tutorial, but I notice as you load in the palettes, you're using a variable that is just assigned to some number. I've used 0-4 in this alone. How many palettes are available?
Logged
Jeremysr
First Quarter
***
Posts: 215



WWW
« Reply #1 on: March 04, 2007, 01:45:39 AM »

I can't run it because I don't have a working homebrew device at the moment (plus the one I have doesn't support GBFS), but the code looks good!

For palettes, you can use any number you want (just not negative, I think). But of course there's a limit. According to the PAlib tutorials (we use PAlib to make DSLua) there can be 16 palettes. But Daltonlaffs has posted a way to use one palette for all your sprites here: http://www.dslua.com/component/option,com_smf/Itemid,19/topic,243.0
Logged
daltonlaffs
First Quarter
***
Posts: 189


Freaking Insane


WWW
« Reply #2 on: March 04, 2007, 07:45:11 AM »

As you said, it isn't much, but this is actually pretty nice output, especially from a new user!

As Jeremysr said, it is possible to combine all your sprites' colorsets to make one palette work for them all. However, you WILL have to load it twice (once for bottom screen {Sprite.LoadPalette(0,0,"allpal.pal")} and once for the top {Sprite.LoadPalette(1,1,"allpal.pal")}.)

Additionally, SOME sprites (mostly only sprites you convert directly from GIFs) use 'special palettes'. Those will probably NOT work with my method. However, the only time I've ever seen one is when I convert directly from a GIF. Other than that, there aren't very many exceptions, if any...

And glad that you liked DSLua. To be totally honest, before I started it, I thought DS homebrew was *crap*. But this was the easy push I needed, and soon C++ became easier and easier, until I learned PALib entirely. I am now learning the entire dev package (devkitPRO!), and wouldn't be if I didn't have this easy start...

Err, anyway, if you're worried about how slow this runs... know that I have tested it on 2 different compatible carts and it runs full-speed  Grin
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
sylus101
Waxing Crescent
**
Posts: 68



« Reply #3 on: March 04, 2007, 11:45:16 AM »

Odd, it runs full speed on my emu's... no worries though.

I had been wondering from the beginning if 1 (or 2 per screen) palette's would work. If taken literally, I picture a painter's palette, and figured that as long as all the colors needed were available there that you should only need one.

I'll keep posting progress. It's likely that I'll be stopping this and moving more towards what I really want to get out of the game I have in mind.

Thanks everyone, and take care!
Logged
Pages: [1]
« previous next »
    Jump to: