Sega Dev on Vista Need Help

Discussion in 'Sega Discussion' started by kevster, Feb 17, 2011.

  1. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    Here you go ( see attached ). Please search the BasiEgaXorz documentation when you're not familiar with a command or operator.
     

    Attached Files:

    • 503.zip
      File size:
      1.5 KB
      Views:
      82
    Last edited: Feb 22, 2011
  2. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    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. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    Moving a sprite like that is easy ( see attached ) .. it won't do you any good for car movement though.
     

    Attached Files:

    • Move.zip
      File size:
      279 bytes
      Views:
      79
  6. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    Thanks again, but why would it not be any good for car movment as it worked in micro machines ????
     
  7. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    Because you want the movement vector to be relative ( directly or indirectly ) to the rotation angle.

    [​IMG]
     
  8. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    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_table#Computing_sines

    Edit : Have a look at "shnakeee2.bex" in the BasiEgaXorz examples folder.
     
    Last edited: Feb 23, 2011
  11. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    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. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    ill give them both a looksie

    roller COASTER looks dam complex lol
     
    Last edited: Feb 23, 2011
  14. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    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:

    • 503.zip
      File size:
      1.5 KB
      Views:
      74
    Last edited: Feb 23, 2011
  16. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    cheers i will study it hard
     
  17. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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. Kjell

    Kjell Member

    Joined:
    Dec 8, 2010
    Messages:
    21
    Likes Received:
    0
    Set the volume back to 0 using psgvol :thumbsup:
     
  20. kevster

    kevster Micro Machines World Champ

    Joined:
    Jun 25, 2005
    Messages:
    452
    Likes Received:
    3
    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: Mar 6, 2011
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page