Re: Haohmaru Demo

From David Michel <xxxxxx@easynet.fr>
Date
>Anyhow, if you wanna see it, download walker2.zip from this page:
>
>http://expert.cc.purdue.edu/~shorton/walker2.zip
>
>Let me know what you think!  BTW, if anyone knows how I can control the
>arrow keys to make the guy move left and right, that'd be neat.  

    Cool! Too bad the sprite is so little, it's difficult to recognize. :)

    About the controller, that's very easy. The 'joy' variable
    contains the current state of the controller. Bit 0 contains the
    state of button I, bit 1 of button II, etc... You will find predefined
    symbols for all the bits in the "startup.asm" file, they are of the
    form JOY_BITxxx or JOY_xxx, depending if you need bit numbers or
    or bit masks. A simple main loop that checks the controller will look
    like that:

    .loop:      vsync

                tst #JOY_RIGHT,joy
                beq .right
                tst #JOY_LEFT,joy
                beq .left
                
                bra .loop
    .right:
                ...
                bra .loop
    .left:
                ...
                bra .loop

    Don't forget that the bit logic is inverted, 0 means direction/button
    pressed.

    David