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 - Pocket C game speed

Pocket C game speed

Discuss PocketC for Palm OS (including Desktop Edition)

Postby Velvis on Sun Apr 01, 2001 4:09 am

I have been fooling around with PocketC and Joes toolbox for the last couple of days. I put together a simple "Space Invaders" type game. So far just the players ship (moves left and right) and missle firing code. No aliens or collision detection. Unfortunatly the program slows considerably when the missle is fired and the player is moving.

Since this is before any aliens ( I only planned on a 3, not like space invaders 30 or so) I was thinking that perhaps Pocket C even with Joes library isnt fast enough for something like this.

On the other hand my programming knowledge is limited and perhaps I am doing something wrong.(basically my event loop uses the checkkey for left and right movement and updates the screen as needed. For the fire button I first check for the up button, if so I draw the missle and set a flag. The event loop checks this flag if it is set the missle is further incremented and drawn. after it reaches the top the flag is unset.
(this allows ship movement while the missile moves up)

Functionally, it works just like I wanted it to, but speed is the issue, especially considering no game code has been programmed yet.

Any suggestions or should I pack it away for when a 300 MHZ palm exists?
Velvis
 
Posts: 226
Joined: Mon Dec 11, 2000 2:32 am

Postby Vilmos on Sun Apr 01, 2001 9:29 am

There are a lot of things you can do to optimize your PocketC code. Not all of them are things that you would necessarily think of. Check out the optimization posts in the other forum. Joseph Stadolnik (sorry if I spelled it wrong:) has done a lot of testing and there is a lot to digest. That's in the PocketC Knowledgebase.

One quick thought might be to try drawing your shot a few different ways. Which is faster, a bitmap, line, rect? I haven't seen any comparisons and with the native libraries it makes a lot more comparisons to be made.

Actually I just thought of one important area. You mention that you are using CheckKey so I assume you are using the hardware polling to get the fastest event loop. Do you have an event() in that loop anywhere? The default setting on event is to wait forever for an event. If you want to have a fast loop set it lower.

I just checked my code and I used e=event(0) to make a fast loop. From your post I'm not sure if you are leaving room for screen taps in your event loop yet or if the math is just slowing you down at this point.

Vilmos



Edited by - vilmos on 04/01/2001 04:35:53
Vilmos
 
Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby Vilmos on Sun Apr 01, 2001 9:44 am

Wouldn't you know it after reading your message and thinking about an arcade shooter I go to PalmGear and someone has updated one written in PocketC called Shooter. Heh, timing is perfect.

I can't Hotsync here at work so I have no idea about the speed, but take a look at it. I like to think the speed would be decent if the program is published, but you never know.

Vilmos
Vilmos
 
Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby Velvis on Sun Apr 01, 2001 1:06 pm

I did check out the shooter game, is wasnt written with Joe's toolbox and isnt a "shooter" in the Space Invaders vein.

I will look at the optimization info you mentioned.
Velvis
 
Posts: 226
Joined: Mon Dec 11, 2000 2:32 am


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 4 guests

cron