Select language
Search the Site
Ceebot / Dauphin Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Framerate slowing down with very simple program (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Framerate slowing down with very simple program
#3
Jeff (Visitor)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Framerate slowing down with very simple program 16 Years, 1 Month ago Karma: 0  
Here is a program I wrote:

extern void object::test()
{
....object item;
....while(true)
....{
........item=radar(WheeledShooter);
........turn(direction(item.position));
........if (this.category == AlienAnt && distance(this.position,item.position) < 12)
........{
............fire(item.position);
........}
....}
}

When I run it in CeeBot, the framerate drops dramatically; the program just gets slow. Where is the problem?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#11
OttoDeveloper (Moderator)
Moderator
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:Framerate slowing down with very simple program 16 Years, 1 Month ago Karma: 0  
At each frame, this program will be repeated indefinitely, until the maximum limit of intructions per frame (5000) is reached. At the end of the while loop, just add wait(0.01), and the problem is solved. After each control loop, there should be a small wait() in order to allow CeeBot to get to the next frame.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop