Seite 97 von 340 ErsteErste ... 47 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 147 197 ... LetzteLetzte
Zeige Ergebnis 2.881 bis 2.910 von 10174

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Zitat von Waterbottle Can't you just call rand() every time you want a new random value...? If you look on ...

  
  1. #2881
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Waterbottle
    Can't you just call rand() every time you want a new random value...?
    If you look on page 289, BlackShark shows the method that im currently using for random numbers, its good but it gets chosen every second, even if i type GetRandomNumber(no1, no2) again, it doesnt do it until the next second is up...

    Heres what BlackShark wrote:
    Zitat Zitat von BlackShark
    Try defining this above your while loop...


    Code:
    int GetRandomNum(int lo, int hi) {
    SceKernelUtilsMt19937Cont ext ctx;
    sceKernelUtilsMt19937Init (&ctx, time(NULL)); //SEED TO TIME
    u32 rand_val = sceKernelUtilsMt19937UInt (&ctx);
    rand_val = lo + rand_val % hi;
    return (int)rand_val;
    }
    Then call it like,


    Code:
    GetRandomNum(*INSERT # HERE* , *INSERT # HERE*)

    O yes, and MAKE SURE that you put


    Code:
    #include </usr/include/sys/stat.h>
    up were the rest of your #include's are let me know if this works for you.


    ...Just Returned To The Scene...

  2. #2882
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    ok i have a prob with my 3d object
    Spoiler for code of rotation:

    Code:
    	float inc_rate = 0.1f;
    	droney[1] += inc_rate;
    	float angle = droney[1]*(PI/180.0f);
    
    	
            dronexrot = (float)sin((angle+90.0f)*(PI/180.0f))*(0.02f);
    	dronezrot = (float)cos((angle+90.0f)*(PI/180.0f))*(0.02f)*-1;
    	dronex[1] = dronexrot;
    	dronez[1] = dronezrot;
    
    	float xtrans = -10-xpos+dronex[1];
    	float ztrans = -10-zpos+dronez[1];
    	float ytrans = -walkbias-0.45f-ypos;
    	float sceneroty = ((360.0f)*(PI/180.0f)) - ((yrot)*(PI/180.0f));
    	sceGumLoadIdentity();
            {
    		ScePspFVector3 move = {xtrans,ytrans, ztrans};
    		sceGumRotateX(lookupdown);
    		sceGumRotateY(sceneroty);
    		sceGumTranslate( &move );
    		sceGumRotateY(angle);
    
    	}

    thats just for rotation i got it to rotate in degrees instead of radians but now i can't get the object to move in the direction it is faceing and i'm not sure why i believe that code should work but it won't and it's makeing mad i've made countless modifications 2 it yet it still won't work
    um just wanted to make sure my prob hasn't got lost also don't think i've just stopped after posting i've been trying other ways of course to no avail
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  3. #2883
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von JaSo PsP
    If you look on page 289, BlackShark shows the method that im currently using for random numbers, its good but it gets chosen every second, even if i type GetRandomNumber(no1, no2) again, it doesnt do it until the next second is up...
    That function is one I wrote.

    If it's taking a second to execute, you're doing something else wrong, post up your code.

    You should never expect an answer either as you did, the ratio between people asking questions and the people knowledgable enough to answer them is sided very much toward the askers.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  4. #2884
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    yes that is IWN's function, I just got it from one of his Tuts (Awesome tuts by the way IWN, helped me alot)
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  5. #2885
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insert_Witty_Name
    That function is one I wrote.

    If it's taking a second to execute, you're doing something else wrong, post up your code.

    You should never expect an answer either as you did, the ratio between people asking questions and the people knowledgable enough to answer them is sided very much toward the askers.
    My code is:
    Spoiler for Code:
    Code:
    //Race Game
    
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <png.h>
    #include <stdio.h>
    #include </usr/include/sys/stat.h>
    #include "graphics.h"
    
    PSP_MODULE_INFO("Race Game", 0, 1, 1);
    
    #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
    typedef enum _bool { false, true } bool;
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    
    int main()
    {
        bool exitFlag = false, resetFlag = false;
        
        while(exitFlag == false)
        {
        char playerBuffer1[100];
        char playerBuffer2[100];
        char comBuffer1[100];
        char comBuffer2[100];
        char finishBuffer[100];
        char winningText[40];
        char difficultyText[30];
        
        Image* finish;
        Image* player;
        Image* com;
        Image* pf1;
        Image* pf2;
        Image* cf1;
        Image* cf2;
        
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
        
        int GetRandomNum(int lo, int hi)
        {
            SceKernelUtilsMt19937Context ctx;
            sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
            u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
            rand_val = lo + rand_val % hi;
            return (int)rand_val;
        }
        
        int playerX = 5;
        int playerY = 106;
        int comX = 5;
        int comY = 160;
        int pstate = 0;
        int cstate = 0;
        int finishPointP;
        int finishPointC;
        int winner;
        int difficulty = 20;
        int diff2;
        int i;
        int players;
        int randNum;
        
        sprintf(finishBuffer, "finishLine.png");
        sprintf(playerBuffer1, "playerFrame1.png");
        sprintf(playerBuffer2, "playerFrame2.png");
        sprintf(comBuffer1, "comFrame1.png");
        sprintf(comBuffer2, "comFrame2.png");
        
        pf1 = loadImage(playerBuffer1);
        pf2 = loadImage(playerBuffer2);
        cf1 = loadImage(comBuffer1);
        cf2 = loadImage(comBuffer2);
        finish = loadImage(finishBuffer);
        
        com = cf1;
        player = pf1;
        
        Color basicText = RGB(100, 100, 100);
        Color textSelected = RGB(255, 20, 20);
        
        SceCtrlData pad;
        
        while(resetFlag == false)
        {
        while(1)
        {
                sceCtrlReadBufferPositive(&pad, 1);
                clearScreen(0);
                
                printTextScreen(200, 20, "Running Race, By Jason", basicText);
                printTextScreen(200, 40, "Press the L trigger for one player", basicText);
                printTextScreen(200, 30, "Press the R trigger for two player", basicText);
                sprintf(difficultyText, "Difficulty: %i", difficulty);
                
                printTextScreen(200, 70, difficultyText, textSelected);
                            
                if(pad.Buttons & PSP_CTRL_RIGHT)
                {
                               difficulty++;
                               for(i = 0; i < 5; i++)
                               {
                                      sceDisplayWaitVblankStart();
                               }
                }
                else if(pad.Buttons & PSP_CTRL_LEFT)
                {
                               difficulty--;
                               for(i = 0; i < 5; i++)
                               {
                                      sceDisplayWaitVblankStart();
                               }
                }
                else if(pad.Buttons & PSP_CTRL_LTRIGGER)
                {
                     diff2 = difficulty - 1;
                     players = 1;
                     break;
                }
                else if(pad.Buttons & PSP_CTRL_RTRIGGER)
                {
                     players = 2;
                     break;
                }
                flipScreen();
        }
        
        while(players == 1)
        {
                sceCtrlReadBufferPositive(&pad, 1);
                clearScreen(0);
                
                randNum = GetRandomNum(0, difficulty);
                
                finishPointP = playerX + 20;
                finishPointC = comX + 20;
                
                if(randNum == diff2)
                {
                           do
                           {
                            if(cstate == 0)
                            {
                                      com = cf2;
                                      comX += 3;
                                      cstate = 1;
                            }
                            else if(cstate == 1)
                            {
                                      com = cf1;
                                      comX += 3;
                                      cstate = 0;
                            }
                            }
                            while(randNum != diff2);
                            randNum = 999;
                }
                
                blitAlphaImageToScreen(0, 0, 20, 40, com, comX, comY);
                blitAlphaImageToScreen(0, 0, 20, 40, player, playerX, playerY);
                blitAlphaImageToScreen(0, 0, 20, 272, finish, 460, 0);
                
                if(finishPointP > 460)
                {
                                winner = 0;
                                resetFlag = true;
                                exitFlag = false;
                                break;
                }
                else if(finishPointC > 460)
                {
                                winner = 1;
                                resetFlag = true;
                                exitFlag = true;
                                break;
                }
                
                if(pad.Buttons & PSP_CTRL_CROSS)
                {
                               if(pad.Buttons & PSP_CTRL_CIRCLE)
                               {
                               }
                               else if(pstate == 0)
                               {
                                        player = pf2;
                                        playerX += 3;
                                        pstate = 1;
                               }
                }
                
                if(pad.Buttons & PSP_CTRL_CIRCLE)
                {
                               if(pad.Buttons & PSP_CTRL_CROSS)
                               {
                               }
                               else if(pstate == 1)
                               {
                                        player = pf1;
                                        playerX += 3;
                                        pstate = 0;
                               }
                }
                flipScreen();
        }
        
        while(players == 2)
        {
                sceCtrlReadBufferPositive(&pad, 1);
                clearScreen(0);
                
                finishPointP = playerX + 20;
                finishPointC = comX + 20;
                
                blitAlphaImageToScreen(0, 0, 20, 40, com, comX, comY);
                blitAlphaImageToScreen(0, 0, 20, 40, player, playerX, playerY);
                blitAlphaImageToScreen(0, 0, 20, 272, finish, 460, 0);
                
                if(finishPointP > 460)
                {
                                winner = 0;
                                resetFlag = true;
                                exitFlag = false;
                                break;
                }
                else if(finishPointC > 460)
                {
                                winner = 1;
                                resetFlag = true;
                                exitFlag = false;
                                break;
                }
                
                if(pad.Buttons & PSP_CTRL_LEFT)
                {
                               if(pad.Buttons & PSP_CTRL_DOWN)
                               {
                               }
                               else if(cstate == 0)
                               {
                                         com = cf2;
                                         comX += 3;
                                         cstate = 1;
                               }
                }
                
                if(pad.Buttons & PSP_CTRL_DOWN)
                {
                               if(pad.Buttons & PSP_CTRL_LEFT)
                               {
                               }
                               else if(cstate == 1)
                               {
                                         com = cf1;
                                         comX += 3;
                                         cstate = 0;
                               }
                }
                
                if(pad.Buttons & PSP_CTRL_CROSS)
                {
                               if(pad.Buttons & PSP_CTRL_CIRCLE)
                               {
                               }
                               else if(pstate == 0)
                               {
                                        player = pf2;
                                        playerX += 3;
                                        pstate = 1;
                               }
                }
                
                if(pad.Buttons & PSP_CTRL_CIRCLE)
                {
                               if(pad.Buttons & PSP_CTRL_CROSS)
                               {
                               }
                               else if(pstate == 1)
                               {
                                        player = pf1;
                                        playerX += 3;
                                        pstate = 0;
                               }
                }
                flipScreen();
        }
        }
        
        
        if(winner == 0)
        {
             if(players == 1)
             {
                  sprintf(winningText, "You Won!  --  Start To Restart");
             }
             else if(players == 2)
             {
                  sprintf(winningText, "Player 1 Won!  --  Start To Restart");
             }
        }
        else if(winner == 1)
        {
             if(players == 1)
             {
                  sprintf(winningText, "The Computer Won  --  Start To Restart");
             }
             else if(players == 2)
             {
                  sprintf(winningText, "Player 2 Won!  --  Start To Restart");
             }
        }
        
        clearScreen(0);
        printTextScreen(200, 140, winningText, basicText);
        
        flipScreen();
        while(1)
        {
                sceCtrlReadBufferPositive(&pad, 1);
                if(pad.Buttons & PSP_CTRL_START)
                {
                               resetFlag = false;
                               break;
                }
        }
        }
        
        sceKernelSleepThread();
        return 0;
    }
    ...Just Returned To The Scene...

  6. #2886
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    This code:

    Code:
        int GetRandomNum(int lo, int hi)
        {
            SceKernelUtilsMt19937Context ctx;
            sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
            u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
            rand_val = lo + rand_val % hi;
            return (int)rand_val;
        }
    Is a function, and should be before your main function, not inside it.

    That must have given you warnings when compiling... Never ignore warnings.

    Link to the tutorial previously mentioned: http://www.psp-programming.com/forum...hp?topic=961.0

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  7. #2887
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insert_Witty_Name
    This code:

    Code:
        int GetRandomNum(int lo, int hi)
        {
            SceKernelUtilsMt19937Context ctx;
            sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
            u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
            rand_val = lo + rand_val % hi;
            return (int)rand_val;
        }
    Is a function, and should be before your main function, not inside it.

    That must have given you warnings when compiling... Never ignore warnings.

    Link to the tutorial previously mentioned: http://www.psp-programming.com/forum...hp?topic=961.0
    nope, cygwin didnt give any warnings. And yeah, i shouldve noticed that, too much code confuses me...
    ...Just Returned To The Scene...

  8. #2888
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark

    Try defining this above your while loop...

    Code:
    int GetRandomNum(int lo, int hi) {
     SceKernelUtilsMt19937Context ctx;
     sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
     u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
     rand_val = lo + rand_val % hi;
     return (int)rand_val;
    }

    That probably would have been it,

    any way, Does any body know how I can set up a for directional bullet system?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  9. #2889
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    @blackshark simple create a var to contain the direction of your bullet then a simple if statement telling if it is this direction then move this way

    i still need help on:

    Zitat Zitat von slicer4ever
    ok i have a prob with my 3d object
    Spoiler for code of rotation:

    Code:
    	float inc_rate = 0.1f;
    	droney[1] += inc_rate;
    	float angle = droney[1]*(PI/180.0f);
    
    	
            dronexrot = (float)sin((angle+90.0f)*(PI/180.0f))*(0.02f);
    	dronezrot = (float)cos((angle+90.0f)*(PI/180.0f))*(0.02f)*-1;
    	dronex[1] = dronexrot;
    	dronez[1] = dronezrot;
    
    	float xtrans = -10-xpos+dronex[1];
    	float ztrans = -10-zpos+dronez[1];
    	float ytrans = -walkbias-0.45f-ypos;
    	float sceneroty = ((360.0f)*(PI/180.0f)) - ((yrot)*(PI/180.0f));
    	sceGumLoadIdentity();
            {
    		ScePspFVector3 move = {xtrans,ytrans, ztrans};
    		sceGumRotateX(lookupdown);
    		sceGumRotateY(sceneroty);
    		sceGumTranslate( &move );
    		sceGumRotateY(angle);
    
    	}

    thats just for rotation i got it to rotate in degrees instead of radians but now i can't get the object to move in the direction it is faceing and i'm not sure why i believe that code should work but it won't and it's makeing mad i've made countless modifications 2 it yet it still won't work
    -= Double Post =-
    nvm i got it working now i can finally continue with my game=-)
    Geändert von slicer4ever (02-21-2007 um 02:53 PM Uhr) Grund: Automerged Doublepost
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  10. #2890
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark

    That probably would have been it,

    any way, Does any body know how I can set up a for directional bullet system?[/COLOR]
    Consider this "Half-full"+ or "Half-Empty"-. That's up to you, IMHonestO I think it's fair to come up with generic question but not with ones that are specific to gameplay, becz that's what makes it unique

    Btw, how's the progress goin?
    Geändert von Mr305 (02-21-2007 um 06:39 PM Uhr)

  11. #2891
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insert_Witty_Name
    This code:

    Code:
        int GetRandomNum(int lo, int hi)
        {
            SceKernelUtilsMt19937Context ctx;
            sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
            u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
            rand_val = lo + rand_val % hi;
            return (int)rand_val;
        }
    Is a function, and should be before your main function, not inside it.

    That must have given you warnings when compiling... Never ignore warnings.

    Link to the tutorial previously mentioned: http://www.psp-programming.com/forum...hp?topic=961.0

    does it work with negatives? as in:

    GetRandomNum(-10, 10);

    would that work?
    --------------------------------------------------------------------------------------

  12. #2892
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    math prob:

    how do i find the angle of an object compared fto another object

    e.g. my object is sitting in a position i click somewhere now i need to find the current angle of the clicked position and my objects position...how?
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  13. #2893
    QJ Gamer Bronze
    Points: 4.912, Level: 44
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    90
    Points
    4.912
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    use the atan2f function.

    example:
    Code:
    float theta = atan2f(objecty - clickedy, objectx - clickedx);
    You may have to switch the object and clicked positions depending on from which position you want the angle to be measured.

  14. #2894
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Mr305
    Consider this "Half-full"+ or "Half-Empty"-. That's up to you, IMHonestO I think it's fair to come up with generic question but not with ones that are specific to gameplay, becz that's what makes it unique

    Btw, how's the progress goin?
    Ok so far, definetly a learning experience, working on AI now, (still no bullet system) Id give you a screen shot of the menu (pretty much done) and the game but I can't do screen shots yet. maybe later!
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  15. #2895
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    @nataku i did that but i forgot to remove another part of the script which reset the angle before it was rotated thats y i asked but now it's all fixed anywyas can i ask whats the diffrence between atan and atan2?(always wondered)
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  16. #2896
    QJ Gamer Bronze
    Points: 4.912, Level: 44
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    90
    Points
    4.912
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    atan2 is able to return an angle from -pi to pi, while atan can only return -pi/2 to pi/2

  17. #2897
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    o i see
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  18. #2898
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Would someone mind posting a code for scanning a directory? I have researched quite a bit, including looking though th SDK includes, but I just can't get it right. I just need to know the files in a directory, and whether or not they are files or folders.

  19. #2899
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Im trying to compile a id3 lib but it just wont work:
    Code:
    [email protected] /cygdrive/c/projects/pxs
    $ cd c:/projects/id3lib-5
    
    [email protected] /cygdrive/c/projects/id3lib-5
    $ ./configure --prefix=/home/luser
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets ${MAKE}... yes
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking for C compiler default output... configure: error: C compiler cannot cr
    eate executables

  20. #2900
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    If you are using that PSPDev Win32 thing, it wotn work.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  21. #2901
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    im re-installing cygwin now...

  22. #2902
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Uhm, good for you?

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  23. #2903
    QJ Gamer Blue
    Points: 3.624, Level: 37
    Level completed: 83%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    67
    Points
    3.624
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    meh stop spamming the thread psp12 ,please.

    Access_Denied : I think when you scan a directory, the sub-folders end with a / , if it ends by / , youre sure that it's not a file. I can't provide you my code, it's bugged as hell ^^

  24. #2904
    Mushroom Man
    Points: 7.283, Level: 56
    Level completed: 67%, Points required for next Level: 67
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    UK
    Beiträge
    318
    Points
    7.283
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Would someone mind posting a code for scanning a directory? I have researched quite a bit, including looking though th SDK includes, but I just can't get it right. I just need to know the files in a directory, and whether or not they are files or folders.
    Do you need to scan all sub-directories as well? I have my resource loading function for Traveller that scans a directory and loads all PNG files found into the resource holder, however it is not recursive, although that would not involve much modification. If this could be of help I'll clean it up and post it for you :)

  25. #2905
    Developer
    Points: 12.154, Level: 72
    Level completed: 26%, Points required for next Level: 296
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Dubuque
    Beiträge
    423
    Points
    12.154
    Level
    72
    My Mood
    Lurking
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Would someone mind posting a code for scanning a directory? I have researched quite a bit, including looking though th SDK includes, but I just can't get it right. I just need to know the files in a directory, and whether or not they are files or folders.
    http://www.psp-programming.com/forum...ic,1333.0.html
    PSP Demo Videos (updated 11/29/08)
    MinerPSP Coder

  26. #2906
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    How can I make a code that says some thin like if the power switch is pressed up then do whatever i want. how would i do that?

  27. #2907
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Check out C:/cygwin/usr/local/pspdev/psp/sdk/include/pspctrl.h

  28. #2908
    QJ Gamer Silver
    Points: 7.385, Level: 57
    Level completed: 18%, Points required for next Level: 165
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Finland
    Beiträge
    752
    Points
    7.385
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Check out C:/cygwin/usr/local/pspdev/psp/sdk/include/pspctrl.h
    Or the docs, at /usr/local/pspdev/psp/sdk/doc/html/index.html :)
    wheeee =:D

  29. #2909
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Which one of these would be the power switch:
    Code:
    	/** Select button. */
    	PSP_CTRL_SELECT     = 0x000001,
    	/** Start button. */
    	PSP_CTRL_START      = 0x000008,
    	/** Up D-Pad button. */
    	PSP_CTRL_UP         = 0x000010,
    	/** Right D-Pad button. */
    	PSP_CTRL_RIGHT      = 0x000020,
    	/** Down D-Pad button. */
    	PSP_CTRL_DOWN      	= 0x000040,
    	/** Left D-Pad button. */
    	PSP_CTRL_LEFT      	= 0x000080,
    	/** Left trigger. */
    	PSP_CTRL_LTRIGGER   = 0x000100,
    	/** Right trigger. */
    	PSP_CTRL_RTRIGGER   = 0x000200,
    	/** Triangle button. */
    	PSP_CTRL_TRIANGLE   = 0x001000,
    	/** Circle button. */
    	PSP_CTRL_CIRCLE     = 0x002000,
    	/** Cross button. */
    	PSP_CTRL_CROSS      = 0x004000,
    	/** Square button. */
    	PSP_CTRL_SQUARE     = 0x008000,
    	/** Home button. */
    	PSP_CTRL_HOME       = 0x010000,
    	/** Hold button. */
    	PSP_CTRL_HOLD       = 0x020000,
    	/** Music Note button. */
    	PSP_CTRL_NOTE       = 0x800000,
    	/** Screen button. */
    	PSP_CTRL_SCREEN     = 0x400000,
    	/** Volume up button. */
    	PSP_CTRL_VOLUP      = 0x100000,
    	/** Volume down button. */
    	PSP_CTRL_VOLDOWN    = 0x200000,
    	/** Wlan switch up. */
    	PSP_CTRL_WLAN_UP    = 0x040000,
    	/** Remote hold position. */
    	PSP_CTRL_REMOTE     = 0x080000,	
    	/** Disc present. */
    	PSP_CTRL_DISC       = 0x1000000,
    	/** Memory stick present. */
    	PSP_CTRL_MS         = 0x2000000,
    };

  30. #2910
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    The power switch is in the psppower.h file. Look at the PSPSDK sample on how to use it.

    (lol @ access_denied suggesting pspctrl)
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:27 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .