Here you go ( see attached ). Please search the BasiEgaXorz documentation when you're not familiar with a command or operator.
Here you go ( see attached ). Please search the BasiEgaXorz documentation when you're not familiar with a command or operator.
Last edited by Kjell; 02-22-2011 at 09:44 AM. Reason: Shortened the select case.
I have been tinkering with that example you quite generously showed me, but i don't think my brain is quite good enough, first i tried to replace your sprite with my own, exported the palette and sprite info but it ended up being in 2 halves and also looked over the examples which came with BasiEgaXorz in relation to forward motion but every time i try and slip in the code i think is related to movement i just get a broken sprite ?
Obviously you're doing something wrong, but it's hard to guess what exactly without seeing any code :rolleyes:
Anyway .. the reason why your sprite might appear "split" is because the Mega Drive ( only ) supports sprites up to 32x32 pixels. For the car movement you want to generate a sin & cos lookup table with a length equal to your supported angles.
from an example i found i first copied the following
JoyPad:
do 'start the main loop
sleep 1 'set frame rate
movesprite UP,x,y
j=joypad()
'change labels for instructions
if j.0 then gosub moveUP
if j.1 then gosub moveDOWN
if j.2 then gosub moveLEFT
if j.3 then gosub moveRIGHT
loop 'end the main loop
moveUP:
propsprite UP,256,0 'to change animations use propsprite and change the tiles by changing the "tile vram offset" to the new tiles
y-- 'move the sprite up
return 'return to the maim loop
moveDOWN:
propsprite UP,257,0 'to change animations use propsprite and change the tiles by changing the "tile vram offset" to the new tiles
y++ 'move the sprite down
return 'return to the maim loop
then i tried to complie but it works with broken graphics in fact no graphic shown
Moving a sprite like that is easy ( see attached ) .. it won't do you any good for car movement though.
OK....
So what you are saying is, i have to code in a table for the program to look up so it tells what sprite to show for what ever angle the joypad is at?
But also from this i take it that it is not impossible just dam hard ?
I guess it would involve lots of if's and whiles and would you be able to map the forward and reverse motion to the A & B buttons on the joy pad
??????????????????
No, this has nothing to do with sprites. The Mega Drive ( like most consoles from that era ) doesn't natively support floating point operations, so you want to pre-calculate any values that the hardware can't easily produce.So what you are saying is, i have to code in a table for the program to look up so it tells what sprite to show for what ever angle the joypad is at?
http://en.wikipedia.org/wiki/Lookup_...omputing_sines
Edit : Have a look at "shnakeee2.bex" in the BasiEgaXorz examples folder.
Last edited by Kjell; 02-23-2011 at 12:53 PM.
you mean something akin to this from the example
DATAINT 0, 13, 25, 38, 50, 63, 75, 87
DATAINT 100, 112, 124, 136, 148, 160, 172, 184
DATAINT 195, 207, 218, 230, 241, 252, 263, 273
DATAINT 284, 294, 304, 314, 324, 334, 343, 352
DATAINT 361, 370, 379, 387, 395, 403, 410, 418
Yes.
Use Excel / Javascript or whatever is easiest for you to generate the data .. or if you're really lazy use a application like Roller COASTER.
ill give them both a looksie
roller COASTER looks dam complex lol
Last edited by kevster; 02-23-2011 at 03:17 PM.
I know i keep asking but were would i start in working it out and were abouts in the code would it go?
would it go in between the angle increments or at the start of the program ?
Please take the time to study the examples ( and continue to do so until you truly understand them ), otherwise you'll constantly run into walls.
I've updated the car example with movement when you press up arrow. However ( and this is on purpose ), you won't be able to use the lookup tables I generated as soon as you want to add acceleration.
Good luck ~
Edit : The car might look like it's sliding sideways at times, but this is because there are only 5 sprites ( you want to use more obviously ).
Last edited by Kjell; 02-23-2011 at 05:52 PM.
cheers i will study it hard
well work has been slow has have just mooved but have managed a little work got it workin on A &B for forward n back, looking at psg as well then make map scroll, but updates will be sparse as no net as yet so on my lg optimus on the old gprs lolz
well i have managed to get it to produce a tone when u press the correct button, but it plays continuously how would i make it stop once u lift of the key. have tried sleep but didnt work
i did that but now back to no noise, is there a function for button = lifted off
lookin in the help it looks like u can say when the button is up but as yet not sucsfeull
Last edited by kevster; 03-06-2011 at 05:13 PM.
Bookmarks