0 Members and 1 Guest are viewing this topic.
Hi all,2 examples of programs and videos with the hardware :http://www.dailymotion.com/video/x132v9e_defender_techCode: [Select]EXPORT Defender()BEGIN LOCAL xv:=10,yv:=20; DIMGROB_P(G1,640, 48); DIMGROB_P(G2,320,240); Y:=32; FOR X:=0 TO 640 DO Y:=MIN(MAX(Y-1+IP(RANDOM(3)),0),47); LINE_P(G1,X,48,X,48-Y); FREEZE; END; RECT(); FOR X:=0 TO (640-64) DO xv:=xv+2*(ISKEYDOWN(8)-ISKEYDOWN(7)); yv:=yv+2*(ISKEYDOWN(12)-ISKEYDOWN(2)); BLIT_P(G2,0,0,320,240,G1,X,0,X+64,48); IF GETPIX_P(G2,xv+10,yv+5)==0 THEN BREAK; END; RECT_P(G2,xv,yv,xv+10,yv+5,0,#20B2AAh); BLIT_P(G0,G2); END; FOR N:=1 TO 100 DO INVERT_P; END;END;I tried the same program with a 40*20 pixels for the spaceship and it run at the same speedScroll(1) ->1 pixel scroll http://www.dailymotion.com/video/x130nft_scroll-prime_techCode: [Select]EXPORT Scroll(s)BEGINLOCAL x:=100,y:=100;DIMGROB_P(G1,640,480); FOR N:=1 TO 200 DORECT_P(G1,IP(RANDOM(640)),IP(RANDOM(480)),IP(RANDOM(640)),IP(RANDOM(480)),0,IP(RANDOM(255^3)));END;REPEATx:=MAX(MIN(x+ISKEYDOWN(8)-ISKEYDOWN(7),320),0);y:=MAX(MIN(y+ISKEYDOWN(12)-ISKEYDOWN(2),240),0);BLIT_P(G0,0,0,G1,x,y,320+x,240+y);UNTIL ISKEYDOWN(4);END;
EXPORT Defender()BEGIN LOCAL xv:=10,yv:=20; DIMGROB_P(G1,640, 48); DIMGROB_P(G2,320,240); Y:=32; FOR X:=0 TO 640 DO Y:=MIN(MAX(Y-1+IP(RANDOM(3)),0),47); LINE_P(G1,X,48,X,48-Y); FREEZE; END; RECT(); FOR X:=0 TO (640-64) DO xv:=xv+2*(ISKEYDOWN(8)-ISKEYDOWN(7)); yv:=yv+2*(ISKEYDOWN(12)-ISKEYDOWN(2)); BLIT_P(G2,0,0,320,240,G1,X,0,X+64,48); IF GETPIX_P(G2,xv+10,yv+5)==0 THEN BREAK; END; RECT_P(G2,xv,yv,xv+10,yv+5,0,#20B2AAh); BLIT_P(G0,G2); END; FOR N:=1 TO 100 DO INVERT_P; END;END;
EXPORT Scroll(s)BEGINLOCAL x:=100,y:=100;DIMGROB_P(G1,640,480); FOR N:=1 TO 200 DORECT_P(G1,IP(RANDOM(640)),IP(RANDOM(480)),IP(RANDOM(640)),IP(RANDOM(480)),0,IP(RANDOM(255^3)));END;REPEATx:=MAX(MIN(x+ISKEYDOWN(8)-ISKEYDOWN(7),320),0);y:=MAX(MIN(y+ISKEYDOWN(12)-ISKEYDOWN(2),240),0);BLIT_P(G0,0,0,G1,x,y,320+x,240+y);UNTIL ISKEYDOWN(4);END;
Try to keep NES, SNES and such emulators for later if you code one, though, because as soon as we got emulators on the Nspire, this pretty much killed game development on the platform
I'll get this if it is <$150 and has C/Asm support.
Hey Gilles59, that's some great looking stuff. Thanks for sharing, and welcome to Omnimaga.
I've no time for now but I did some little tests with the small skeletton of the 'defender' program (change color, use sprites, kind of 'radar' in the upper of the screen...). I think the integrated langage of the prime is fast enough for fluid programs like tretis, 'snake', space invader ... even with scrolling...
EXPORT RotaBEGIN LOCAL sa,ca; DIMGROB(G1,40,40); RECT_P(99,79,140,120,0,RGB(255,255,255)); FOR A:=0 TO 10*PI STEP PI/12 DO RECT_P(G1); sa:=SIN(-A); ca:=COS(-A); FOR X:=-20 TO 20 DO FOR Y:=-20 TO 20 DO PIXON_P(G1,X+20,Y+20,GETPIX_P(G0,X*ca-Y*sa+20,X*sa+Y*ca+20)); END; END; BLIT_P(G0,100,80,140,120,G1,0,0,40,40); END; WAIT();END;
Wow 5 FPS is actually pretty darn good considering that is BASIC. Even the CSE has an hard time pulling this with pure ASM when in 320x240 mode.SO basically no scrolling unless you want your game to scroll tile by tile, but pretty fast sprite movement and no long map loading Now to figure out how to avoid having to keep a bunch of tiles displayed to the right side of the screen >.<