Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Tron clone &SerIR

Tron clone &SerIR

A PocketC native palm library offering native forms and assorted utilities

Postby borys on Mon Jan 28, 2002 11:21 pm

Hi!

because i?Ǭ¥ll show some snippets of code, please let me tell you, i?Ǭ¥ve never learned programming until yBasic and PocketC learned me some 1.5 years ago. one year ago i programmed some first games. but i?Ǭ¥m afraid, the code is still inacceptable?
Nevertheless i would like to show my Tron-clone LightSpeed, because i still cannot play it in real, i.e. IR-mode, while it?Ǭ¥s fine with the serial port and the POSE as second palm (it works also on loopback). i?Ǭ¥ve read the comments lately, especially referring to the Vx, which i use, the necessity for the 3.5.3os update, which i have, and the Afterburner cutdown to 16mhz. so there is hope, cause i haven?Ǭ¥t tried the latter, when testing it on the Vx, together with a small III(?), os3.5.3. ach, and i didnt try this two shutdown-commands at the beginning? and there were two versions of PocketC used, my 3.9xx vers. and his 4.0x version, but IR hasn?Ǭ¥t changed?
But fact is, there is still this bit of rubbish code which is good for nothing up to now :( so in case, somebody would like to try it, i?Ǭ¥ll show it here, though it?Ǭ¥s not ready yet (because i didnt want to go on, until the IR works). but it?Ǭ¥s enough playable (there?Ǭ¥s collision and stuff) to try it out. and if you, perhaps, get it to work, please let me know!!! i?Ǭ¥m so anxious!!! i even could expand the game, if someone finds it useful? i?Ǭ¥ve got so much ideas ...

the code:
as you can see, it?Ǭ¥s in seriell state. but it shouldn?Ǭ¥t be hard to switch to IR by setting the parameters (SerIR(ox3), 8NIN). and there?Ǭ¥re just these two shutdowns still to fill in ...

<pre id=code><font face=courier size=2 id=code>

//light 2pl 0.321
library "PToolboxLib"

int x,y,vx,vy,e,p,r,ret,byte;
int x2,y2,vx2,vy2,p2;
int ux,uy,s,c;
string dir;

Start() {
do {//!serdata()
text(25,25," Spielerwahl:");
text(15,40,"(^)PgUp=player1 (schwarz)");
text (15,55,"(v)PgDn=player2 (grau)");
text (15,70,"es sollte nur einer w?ɬ§hlen");
text (25,90,"Steuerung:");
text (20,105," oben(^) = PgUp");
text (20,120,"unten(v)= PgDn" );
text(5,135,"links(<) = ToDo | rechts(>) = Memo");
e=event(0);
if (e==5) {
s=1; text(5,20,"pl.1: s=1");puts("pl.1: s=1 \n");
//sersend(0x2);
sersend(e);
sleep(1000);
break; }
if (e==6) {
s=2; text(5,20,"pl.1: s=2");puts("pl.1: s=2 \n");
//sersend(0x1);
sersend(e);
sleep(1000);
break; }
} while (!serdata())
if (s==0) {
e=serrecv();
//alert(e);
if (e==5) {s=2; text(5,120,"pl.2: s=2");puts("pl.2: s=2");}
if (e==6) {s=1; text(5,120,"pl.2: s=1");puts("pl.2: s=1");}
}
//serrecv();
} //Start()

direct() {
if (e==5) {
ux=0; uy=-1; }
if (e==6) {
ux=0;uy=1; }
if (e==9) {
ux=-1;uy=0; }
if (e==10) {
ux=1;uy=0; }

if (s==1) {
vx=ux;
vy=uy;}
if (s==2) {
vx2=ux;
vy2=uy; }
}//direct()

getpix1() {
sersend(x);
sersend(y);
while(!serdata()) ;
x2=serrecv();
y2=serrecv();
if(x2==200 || y2==200) r=1; alert("other player collids \n you win." ); //
x=x+vx;
y=y+vy;
p=GetPixel(x,y);
}

getpix2() {
sersend(x2);
sersend(y2);
while(!serdata()) ;
x=serrecv();
y=serrecv();
if(x==200 || y==200) r=1; alert("other player collids \n you win." ); //fr?ɬºher: exit();
x2=x2+vx2;
y2=y2+vy2;
p=GetPixel(x2,y2);
}

co() {
r=1;
sersend(200);
sersend(200);
/* c=confirm(" noch einmal?");
if (c) {
sersend(220);
}
else if (!c) {
sersend(240); */
//exit();
}
}//co()

main() {

//seriell:
seropen(57600, "8N1C", 50);
//infrared:
//seropen(57600, "8N1N", 50);

//serIR(0xc);
//uncomment for IR

puts("seropen() - " + ret + "\n");

/*sersend(0x33);serrecv(); serrecv(); for loop*/

clear();
clearg();
graph_on();

while(1) {
//serrecv();serrecv();serrecv();
s=0;e=0;
//clear();
clearg();
Start();

r=0;x=60;y=50;vx=1;vy=0;
x2=65;y2=70;vx2=1;vy2=0;
SetDepth(2);
title("light speed 2 player 0.32");
frame(1,1,15,159,159,0);
hookhard(1);

while(!r) {

if (s==1) getpix1();
if (s==2) getpix2();
SetFore(3); //thats the players colors
line(1,x,y,x,y);
SetFore(2); //thats the players colors
line(1,x2,y2,x2,y2);

if (p>1) {co();
//break;
}
e=event(0);
if (e>4) direct();

}
//wait();
}
//serIR(0);
//serclose();
}

</font id=code></pre id=code>

and if you wanna try my shuttle game, also full of PToolbox, still a mess of ifs and global variables, but a playable demo (land on planet), please go to:
http://unet.univie.ac.at/~a9505562/develop.htm
can you beat my best time, 133? it?Ǭ¥s another unfinshed try of a much bigger and better game, which i?Ǭ¥ll try to realise for the PC.
master of neutry: i have no strong feelings whatsoever.
borys
 
Posts: 1
Joined: Mon Jan 28, 2002 10:27 pm
Location: Austria

Postby jstadolnik on Tue Jan 29, 2002 4:19 am

Have you tried lowering the baud rate to say 300, 1200, or 2400 bps?

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 3 guests

cron