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 - how much is possible?
Page 1 of 1

PostPosted: Sat Feb 24, 2001 1:17 pm
by Eric
<font face=Courier New><font size=2>
hi
i started doing a boulder dash clone with pocketc. i have level, graphics and a movable sprite as player, but when it comes to implementing the moving rocks i get speed problems. you need to "mark" stones that are falling and need to check if they can fall and so on...
maybe i will post the code so far here on the board soon, but i would first of all know what you think:

is something like boulder dash possible?


Eric

</font id=Courier New></font id=size2>

PostPosted: Sat Feb 24, 2001 1:39 pm
by Vilmos
As you found out already there are speed issues with PocketC, and the Palm in general. You're going to have to optimize as much as possible. Are you using a native library to draw the graphics?

There are a few threads on the old web boards about optimizations for PocketC. Take a look there and see if any of that can help your code.

Vilmos

PostPosted: Sat Feb 24, 2001 2:35 pm
by artosoft
Hi,

As Vilmos say about threads on old board of PocketC optimization, people will difficult to dig it out from old web board.

So, how about creating another web board topic beside "PocketC on palmOS topic" just to discuss optimization for pocketC.
Especially for palmOS, because that's our interest here.

There we can ask, reply, discuss about it, and easy to find what we need.

It will be good also if moderator will cut out of topic on optimization topic.

Best regards, Dian Suharto.

PostPosted: Mon Feb 26, 2001 6:01 am
by Eric
<font face=Courier New><font size=2>hi
i guess i would never have gotten so far without the pockettoolbox lib and several drawing "layers".
i know about the speed "problems" on palm in general and pocketc in special. i too would be interested in discusussing (and testing) speed aspects.
there is the knowledge board. maybe we should post there? or paste any good ideas from here to there?

i dont have the code with me, but i will try post it later on today...

Eric
</font id=size2></font id=Courier New>

PostPosted: Tue Feb 27, 2001 6:05 am
by Eric
me again.
meanwhile i read the topic about optimization on the other board and know some parts where i can do better.

i still need to know if there is a fastest way to check the hardkeys. we only have the if / else clause. any other ideas?

i will now post my (unmodified) code. maybe you got other hints. im unshure how good the idea about "shifts" is. maybe we should discuss here first and repost the best on the knowledge base?...

eric


<font face=Courier New><font size=2>
// Boulder Bash
// by T. Schweers
library "PToolboxLib"
#define FILE "test_bitmap"
#define TITLE "Boulder Bash 0.03d"
#define TS 16

int t; //debug only

int r,x,y,sx,sy,bx,by;
int tw,th;
pointer arena;

logic();
fall(int x,int y);

main () {
int run=1;

//size of arena: tile width and height - each TSxTS
tw=10;
th=10;

arena=Array("i1,20,20");
arena[1][1]=8;
arena[2][1]=8;
arena[1][2]=9;
arena[2][2]=9;

//position in arena - sp?ɬ§ter aus lvl errechnet
bx=5;
by=5;

graph_on();
title(TITLE);


//copy tiles-bmp to buf 2 - obsolete
r=OpenBmpDb(FILE);
SetDrawBuf(2);
FastBmp(0,0,4);

//generate tiles in buf2
//gang: tile 0
rect(0, 0*TS,0, TS,TS, 0);
//erde: tile 1
rect(2, 1*TS,0, 2*TS-1,TS-1, 0);

//figur: tile 2
bitmap(2*TS,0,"100000018003c003c003c0018007e00ff01bd813c8118813c803c0024002400c30");

//diamant: tile 8
rect(0, 8*TS,0, 9*TS-1,TS-1, 0);
polygon(8*TS+TS/2,TS/2, 4, TS/2, 9);

//boulder: tile 9
rect(0, 9*TS,0, 10*TS-1,TS-1, 0);
ellipse(1, 9*TS+TS/2,TS/2, TS/2, TS/2);


//gen arena in buf1
CustomBuf(1,tw<<4,th<<4);
SetDrawBuf(1);
for (y=0;y<th;y++) {
for (x=0;x<tw;x++) {
CopyRect(2,x<<4,y<<4,arena[y][x]<<4,0,TS,TS,0,0,0);
}
}

SetDrawBuf(0);
CopyRect(1,0,0,0,0,160,160,0,0,0);


// tastenabfragen und spiellogik
y=0;
hookhard(1);
while(run){
t=ticks(); //debug only
r=event(0);

sx=bx;
sy=by;

//falls tastendruck
if (r) {
//oldpos=&arena[by][bx];

if (r==5) {
//hochtaste
--by;
if (!by) { ++by; }
else { if (arena[by][bx]>>1) { ++by; } }
}
else { if (r==6) {
//runtertaste
++by;
if (by>th) { --by; }
else { if (arena[by][bx]>>1) { --by; } }
}
else { if (r==8) {
//links (telefontaste)
--bx;
if (!bx) { ++bx; }
else { if (arena[by][bx]>>1) { ++bx; } }
}
else { if (r==9) {
//rechts (aufgabentaste)
++bx;
if (bx>tw) { --bx; }
else { if (arena[by][bx]>>1) { --bx; } }
}
else { if (r==2) {
//bildschirmtap (ende)
run=0;
}
}}}}

SetDrawBuf(1);
arena[by][bx]=0;
}//ende if (r)

logic(); //jet to do

sx=bx<<4;
sy=by<<4;
//im buf1 aktuelles feld mit "gang" fuellen
CopyRect(2,sx,sy,0,0,TS,TS,0,0,0);

//im buf0 spielfeld und figur pinseln
SetDrawBuf(0);
CopyRect(1,0,0,(sx-80),(sy-80),160,160,0,0,0);
CopyRect(2,80,80,32,32,TS,TS,0,0,0);

text(120,2,ticks()-t);
}//ende while(run)

wait();
}//ende main

</font id=Courier New></font id=size2>

PostPosted: Tue Feb 27, 2001 11:47 am
by Vilmos
There is a fast way to check the hardkeys in the PToolBox. It directly samples the keys instead of waiting for the eventloop. You don't seem to be using it here.

Vilmos

PostPosted: Wed Feb 28, 2001 1:37 am
by jstadolnik
Also check out the "block select" optimization in my optimizer post (I just added this new case).

Basically, you can use the event return value to select functions containing blocks of code. This is faster than a bunch of nested if's.

Also, you can use the CopyRect rotate=-1 mode to eliminate some SetDrawBuf calls.

I plan to release a new "sprite" function in the next toolbox release which too may be of help.

Joe