Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Noob Coding Question

                  
   
  1. #11
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    sorry, but i don't understand that, i just want to know how to use it, i was trying this

    if(analogueX == -127){
    speed += 1;
    }

    but it doesn't work, so what should i be doing?

  2. #12
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Tutorials Logg IV (Beyond the DeadZone)

    Apad positions outside the centre-off sector are tested against each outer sector
    using techniques similar to hit detection.

    The easiest system to implement is a 3×3 grid of square sectors.

    The size of the squares is the analog range divided by the grid size. (in this case, 256/3)

    An RSQ of at least the default magnitude (3698) is used to make sure the central square is
    totally inside the (circular) centre-off sector.

    ex:
    Code:
    if (analogX>42)&&(analogY>42) {/* Apad RIGHT+DOWN */}

  3. #13
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    still doesn't work

  4. #14
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Tutorials Logg V (Return of the Radians)

    A radial system has advantages over the 3x3 grid.
    RSQ minimum = 1, Analog response is smoother.

    Each of the outer sectors is defined by an arc, and bounded by the centre-off circle, and the analog range.
    Eight 45-degree sectors are often used.

    ex:
    PHP Code:
    int lgxA,lgyA;
    lgxA=abs(analogX);
    lgyA=abs(analogY);
    analogX+=analogX;
    analogY+=analogY;
    if (
    analogX>lgyA) {/* Apad RIGHT */};
    if (
    analogX<-lgyA) {/* Apad LEFT */};
    if (
    analogY>lgxA) {/* Apad DOWN */};
    if (
    analogY<-lgxA) {/* Apad UP */}; 

  5. #15
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    still isn't working, here is the code i have( i copied and pasted from your tutorial on the other site)

    /** Returned controller data */
    typedef struct SceCtrlData {
    /** The current read frame. */
    unsigned int TimeStamp;
    /** Bit mask containing zero or more of ::PspCtrlButtons. */
    unsigned int Buttons;
    /** Analogue stick, X axis. */
    unsigned char Lx;
    /** Analogue stick, Y axis. */
    unsigned char Ly;
    /** Reserved. */
    unsigned char Rsrv[6];
    } SceCtrlData;
    const int ANALOGUE_PAD_OFFSET = -127;
    sceCtrlReadBufferPositive(&pad, 1);
    int analogueX = pad.Lx + ANALOGUE_PAD_OFFSET;
    int analogueY = pad.Ly + ANALOGUE_PAD_OFFSET;
    const int DEAD_ZONE_THRESHOLD = 5;
    const int DEAD_ZONE_THRESHOLD_SQUARED = DEAD_ZONE_THRESHOLD * DEAD_ZONE_THRESHOLD;
    int analogueMagnitudeSquared = ( analogueX * analogueX ) + ( analogueY * analogueY );
    if( analogueMagnitudeSquared < DEAD_ZONE_THRESHOLD_SQUARED )
    {
    analogueX = 0;
    analogueY = 0;
    }
    while(1){
    if(frame == 2){
    int lgxA,lgyA;
    lgxA= +analogueX;
    lgyA= +analogueY;
    analogueX+=analogueX;
    analogueY+=analogueY;
    if (analogueX>lgyA) {
    speed+=1;
    }}
    }

  6. #16
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Arrow Epi-Logg

    Software development problems can be helped by use of a:

    BREAKPOINT(int argc, char *argv[])
    { /* print variables to screen,wait for a button push */ }

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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
  •