Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 56

Thread: Sega Dev on Vista Need Help

  1. #21
    Here you go ( see attached ). Please search the BasiEgaXorz documentation when you're not familiar with a command or operator.
    Attached Files Attached Files
    Last edited by Kjell; 02-22-2011 at 09:44 AM. Reason: Shortened the select case.

  2. #22
    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 ?

  3. #23
    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.

  4. #24
    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

  5. #25
    Moving a sprite like that is easy ( see attached ) .. it won't do you any good for car movement though.
    Attached Files Attached Files

  6. #26
    Quote Originally Posted by Kjell View Post
    Moving a sprite like that is easy ( see attached ) .. it won't do you any good for car movement though.
    Thanks again, but why would it not be any good for car movment as it worked in micro machines ????

  7. #27
    Because you want the movement vector to be relative ( directly or indirectly ) to the rotation angle.


  8. #28
    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 ?

  9. #29
    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

    ??????????????????

  10. #30
    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?
    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.

    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.

  11. #31
    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

  12. #32
    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.

  13. #33
    ill give them both a looksie

    roller COASTER looks dam complex lol
    Last edited by kevster; 02-23-2011 at 03:17 PM.

  14. #34
    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 ?

  15. #35
    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 ).
    Attached Files Attached Files
    Last edited by Kjell; 02-23-2011 at 05:52 PM.

  16. #36

  17. #37
    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

  18. #38
    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

  19. #39
    Set the volume back to 0 using psgvol :thumbsup:

  20. #40
    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.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •