Homebrew competition!!


I have done a lot this day.


Now I have a better model for my snowman, he can become bigger, their are "special" stones (arrows), Ice Coins to collect, a better camera and I optimized the graphic for my gp2x (what you cannot see, but it was still a lot of work) Furthermore their are clouds now and a door to other levels (in this case the same again). Hey and have a look at the new tree! :D

https://www.youtube.com/embed/kJXRwcThYFs?feature=oembed
This is amazing man, keep up the good work:)
 
Im giving up, 2 and a half day trying to compile for Pandora and I cant take it anymore, native or cross nothing works, it has put me off completly and I wont be touching anything Pandora coding for a long time thats for sure.
 
Im giving up, 2 and a half day trying to compile for Pandora and I cant take it anymore, native or cross nothing works, it has put me off completly and I wont be touching anything Pandora coding for a long time thats for sure.

Mind uploading the code somewhere so people can take a look at it?


I know situations like this, I often have chased errors like ghosts around for hours, days even, getting mad in the process just to find out the error was a stupid little mistake or bad thinking on my parts - it happens!


Don't let it get you down :)


foxblock out
 
#include "SDL.h"


int main(){


unsigned short sw=800,sh=480,o=0,n=0,hx=sw/2,hy=sh/2,hxc=hx-30,hyc=hy-30;


SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER);


SDL_Surface* d=SDL_SetVideoMode(sw,sh,32,SDL_SWSURFACE);


SDL_Event go;SDL_Rect t,t2;Uint32 colorkey;bool quit=false;


Uint8* key,l=1,f=10,cf,a,w,n1,n2,j,jc=0,cs=4,l1s=3,xh;


int cx,cy,sx,sy,l1,pbird[40][7],ec=0;


int jump,jt;


/* (purple) BIRD


ew[][0] ACTIVE


ew[][1] X


ew[][2] Y


ew[][3] Animation COUNTER


ew[][4] Animatin FRAME


ew[][5] Attack Counter


ew[][6] DRAW IMAGE


*/


if(l==1){cx=50;cy=300;sx=0;sy=0;// START of LEVEL 1 **********


l1=0;


pbird[ec][0]=1;


pbird[ec][1]=900;


pbird[ec][2]=70;


pbird[ec][3]=0;


pbird[ec][4]=1;


pbird[ec][5]=0;


pbird[ec][6]=0;


SDL_Surface* pbirdn1=SDL_LoadBMP("pbirdn1.bmp");


SDL_Surface* pbirdn2=SDL_LoadBMP("pbirdn2.bmp");


SDL_Surface* pbirds1=SDL_LoadBMP("pbirds1.bmp");


SDL_Surface* pbirds2=SDL_LoadBMP("pbirds2.bmp");


SDL_Surface* pbirdn1r=SDL_LoadBMP("pbirdn1r.bmp");


SDL_Surface* pbirdn2r=SDL_LoadBMP("pbirdn2r.bmp");


SDL_Surface* pbirds1r=SDL_LoadBMP("pbirds1r.bmp");


SDL_Surface* pbirds2r=SDL_LoadBMP("pbirds2r.bmp");


SDL_Surface* section1=SDL_LoadBMP("section1.bmp");


SDL_Surface* bmoon=SDL_LoadBMP("bmoon.bmp");


SDL_Surface* l1bf=SDL_LoadBMP("l1bf.bmp");


colorkey=SDL_MapRGB(bmoon->format,0,0,0);


SDL_SetColorKey(l1bf,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(section1,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirdn1,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirdn1r,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirdn2,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirdn2r,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirds1,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirds1r,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirds2,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(pbirds2r,SDL_SRCCOLORKEY,colorkey);


/*SDL_SetColorKey(twalk1,SDL_SRCCOLORKEY,colorkey);


SDL_SetColorKey(jump1,SDL_SRCCOLORKEY,colorkey);*/


while(quit==false&&l==1){while(SDL_PollEvent(&go)){


if(go.type==SDL_QUIT){quit=true;}}


key=SDL_GetKeyState(NULL);


if(key[sDLK_ESCAPE]){quit=true;}


if(key[sDLK_UP]){}


if(key[sDLK_DOWN]){}


if(key[sDLK_LEFT]){


if(cx>hxc){cx-=cs;sx+=cs;l1+=l1s;}sx-=cs;l1-=l1s;cf+=1;if(cf>15){cf=0;a+=1;if(a==5)


{a=1;}}if(a==1){w=1;}if(a==2){w=2;}if(a==3){w=3;}if(a==4){w=2;}n2=0;}else{n2=1;}


if(key[sDLK_RIGHT]){


if(cx<hxc){cx+=cs;sx-=cs;l1-=l1s;}sx+=cs;l1+=l1s;cf+=1;if(cf>15){cf=0;a+=1;if(a==5)


{a=1;}}if(a==1){w=1;}if(a==2){w=2;}if(a==3){w=3;}if(a==4){w=2;}n1=0;}else{n1=1;}


if(key[sDLK_a]){


if(jc<20){cy-=8;jump=1;j=1;jc+=1;}


else{jump=0;}}else{jump=0;}


if(n1==1&&n2==1){w=0;}


if(sx<0){sx=0;cx-=cs;l1+=l1s;}if(cx<0){cx=0;}


if(sx>1360){sx=1360;cx+=cs;l1-=l1s;}if(cx>2100){cx=2100;}


if(jump==0){cy+=8;}if(cy>300){cy=300;j=0;jc=0;jt=12;}


/* DRAW BACKGROUND */


t2.x=0;t2.y=135;t.x=0;t.y=0;t.w=sw;t.h=sh;


SDL_BlitSurface(bmoon,&t,d,&t2);


t2.x=0;t2.y=0;t.x=l1-580;t.y=0;t.w=sw;t.h=sh;


SDL_BlitSurface(l1bf,&t,d,&t2);


t2.x=0;t2.y=0;t.x=sx;t.y=0;t.w=sw;t.h=sh;


SDL_BlitSurface(section1,&t,d,&t2);


/*


pb1.counter+=1;


if(pb1.counter==10){pb1.frame+=1;pb1.counter=0;}


if(pb1.frame==3){pb1.frame=1;}


xh=0;if(cx<pb1.x&&pb1.x-cx<250){xh=2;}


if(cx>pb1.x&&cx-pb1.x<250){xh=1;}


if(xh==0){if(pb1.frame==1){ew[0]=1;}else{ew[0]=3;}}


if(xh==1){//pb1.x-=2;


if(pb1.frame==1){ew[0]=1;}else{ew[0]=3;}}


if(xh==2){//pb1.x+=2;


if(pb1.frame==1){ew[0]=2;}else{ew[0]=4;}}


if(pb1.ac==0&&cx<500){


if(pb1.frame==1){ew[0]=5;}else{ew[0]=7;}pb1.ac+=1;}


if(pb1.ac==0&&cx>=500){


if(pb1.frame==1){ew[0]=6;}else{ew[0]=8;}pb1.ac+=1;}


if(pb1.ac>0){pb1.ac+=1;}if(pb1.ac==2000){pb1.ac=0;}


*/


pbird[ec][3]+=1;if(pbird[ec][3]==10){pbird[ec][4]+=1;pbird[ec][3]=0;}


if(pbird[ec][4]==3){pbird[ec][4]=1;}


xh=0;if(sx+cx<pbird[ec][1]){xh=1;}


if(sx+cx>pbird[ec][1]){xh=2;}


if(xh==0){if(pbird[ec][4]==1){pbird[ec][6]=1;}else{pbird[ec][6]=3;}}


if(xh==1){if(pbird[ec][4]==1){pbird[ec][6]=1;}else{pbird[ec][6]=3;}


/*if(pbird[ec][1]<sx+cx){pbird[ec][1]-=3;} SEPERATE MOVE FROM XH (direction)*/


}


if(xh==2){if(pbird[ec][4]==1){pbird[ec][6]=2;}else{pbird[ec][6]=4;}


if(pbird[ec][1]<sx+1100){pbird[ec][1]+=3;}


}


if(pbird[ec][6]==1){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirdn1,&t,d,&t2);}


if(pbird[ec][6]==2){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirdn1r,&t,d,&t2);}


if(pbird[ec][6]==3){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirdn2,&t,d,&t2);}


if(pbird[ec][6]==4){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirdn2r,&t,d,&t2);}


if(pbird[ec][6]==5){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirds1,&t,d,&t2);}


if(pbird[ec][6]==6){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirds1r,&t,d,&t2);}


if(pbird[ec][6]==7){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirds2,&t,d,&t2);}


if(pbird[ec][6]==8){t2.x=pbird[ec][1]-sx;t2.y=pbird[ec][2];


t.x=0;t.y=0;t.w=60;t.h=60;SDL_BlitSurface(pbirds2r,&t,d,&t2);}


t2.x=0;t2.y=150;t.x=0;t.y=0;t.w=60;t.h=60;


SDL_BlitSurface(pbirdn1,&t,d,&t2);


SDL_Flip(d);t.x=0;t.y=0;t.w=sw;t.h=sh;


SDL_FillRect(d,&t,SDL_MapRGB(d->format,0,0,0));


n=SDL_GetTicks();if(n-o<f){SDL_Delay(f-(n-o));}o=SDL_GetTicks();}


SDL_FreeSurface(l1bf);


SDL_FreeSurface(bmoon);


SDL_FreeSurface(section1);


SDL_FreeSurface(pbirdn1);


SDL_FreeSurface(pbirdn2);


SDL_FreeSurface(pbirds1);


SDL_FreeSurface(pbirds2);


SDL_FreeSurface(pbirdn1r);


SDL_FreeSurface(pbirdn2r);


SDL_FreeSurface(pbirds1r);


SDL_FreeSurface(pbirds2r);}/* END of LEVEL 1 **********/


SDL_Quit();


return 0;


}
 
I tried compiling on Panda and it seemed to work, but trying to run code I got segmentation error, all images is in same folder.


Dont remember all error and warnings I got in all compiling tries here and there. I got some files compiled on desktop but trying to run them on Panda said something about binarys wrong I think.
 
ok looking at the code I saw doubleslash comments, also when I tried compiling GL code it complained about bool, exchanging that to char made that error go away, but here it didnt complain about bool.
 
Seg faults usually occur because you are trying to access memory that either doesn't exist or you aren't allowed to. One of the most common reasons is an uninitialized or null pointer. Off the top of my head, I'm going to guess that SDL_LoadBMP is failing for some reason. That's just a guess, mind. You should really start off with something small, like so:



Code:
#include "SDL.h"

#include <iostream>


int main(){

    unsigned short sw=800,sh=480,o=0,n=0,hx=sw/2,hy=sh/2,hxc=hx-30,hyc=hy-30;

    bool quite = false;

    SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER);

    SDL_Surface* d=SDL_SetVideoMode(sw,sh,32,SDL_SWSURFACE);

    SDL_Event go;

    Uint8 *key;

    SDL_Rect t,t2;


    SDL_Surface* pbirdn1=SDL_LoadBMP("pbirdn1.bmp");

    if (!pbirdn1)

    {

        std::cerr << "SDL_LoadBMP of pbirdn1.bmp failed: " << SDL_GetError() << std::endl;

        exit(1);

    }

    t2.x=0;t2.y=150;t.x=0;t.y=0;t.w=60;t.h=60;

    SDL_BlitSurface(pbirdn1,&t,d,&t2);


    while(quit==false){

        while(SDL_PollEvent(&go)){

            if(go.type==SDL_QUIT){quit=true;}}


            key=SDL_GetKeyState(NULL);

            if(key[SDLK_ESCAPE]){quit=true;}

        }

    }


    SDL_FreeSurface(pbirdn1);


    SDL_Quit();

    return 0;

}

This sample code based on your code will try to load and display just the one BMP file, and will output an error if it fails to load the BMP as I suspect. If it does work, then start building on it, adding your code back in little chunks at a time until you find the error.


If you need any help, just ask :)
 
Last edited by a moderator:
If you install compiler for Pandora what happens? After i turn it off and next time I start it only wants me to enter password, adn it repeats forever, it happen now second time also, the only thing I could do was reflash and then you loose the compiler... Im to tired at this, in the future if someone could make an easy thing somehoe


w Ill take a look, but otherwise I just cant get things to work.
 
Well i think i can officially say i am not going to be able to finish my entry. Got another project with a 30 march deadline, and the guy who was going to do the graphics additions has some personal stuff, so no time either.


Alas, but at least i made a start, so i think jumper will be seen again sometime..


Cheers, and good luck to all competitors! Seeing some great stuff here :)

If you want to compile natevly on the pandora, use a dev extend.

Yep indeed. I've been using Stuckies dev Extend for months, works perfect. The ports/recompiles i did were all compiled on the pandora itself. (major editing and tweaking done on pc though, i need my 2 big screens ; )
 
Last edited by a moderator:
Well i think i can officially say i am not going to be able to finish my entry. Got another project with a 30 march deadline, and the guy who was going to do the graphics additions has some personal stuff, so no time either.


Alas, but at least i made a start, so i think jumper will be seen again sometime..


Cheers, and good luck to all competitors! Seeing some great stuff here :)

If you want to compile natevly on the pandora, use a dev extend.

Yep indeed. I've been using Stuckies dev Extend for months, works perfect. The ports/recompiles i did were all compiled on the pandora itself. (major editing and tweaking done on pc though, i need my 2 big screens ; )
Noooooooo


:(
 
Well i think i can officially say i am not going to be able to finish my entry. Got another project with a 30 march deadline, and the guy who was going to do the graphics additions has some personal stuff, so no time either.


Alas, but at least i made a start, so i think jumper will be seen again sometime..


Cheers, and good luck to all competitors! Seeing some great stuff here :)

If you want to compile natevly on the pandora, use a dev extend.

Yep indeed. I've been using Stuckies dev Extend for months, works perfect. The ports/recompiles i did were all compiled on the pandora itself. (major editing and tweaking done on pc though, i need my 2 big screens ; )
Noooooooo


:(
 
With 11 days to go, 6 of which I'm going to be out of town so not likely to be able to work, it looks like I'm not going to be able to finish. I really should have started sooner :(


Good luck to everyone with better planning skills than me! :D I'll toss some money in the pot.
 
No extending the deadline would be ludicrous and unfair to those that put their effort in to get it in on time. I'm fairly certain a few people are working on games behind the scenes. We've already had an EPIC video from Ziz.


For instance if you've watched my videos I've already completed my game so to be honest, i'd be pissed at myself if I extended the deadline as I worked fooking hard (had little programming knowledge til I made Robo Hell). I'm yet to compile into a pnd though. Should probs do that soon.
 
Back
Top