Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 'Level maker' runs slowly

Author
Message
Tom J
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: Essex, England
Posted: 14th Aug 2007 14:43 Edited at: 14th Aug 2007 14:46
Last night I hurriedly made this very basic level editor:

enter - makes floor
w/a/s/d - makes walls
left/right/up/down - move sphere that 'deposits' the floor/walls

shift - Switches to buggy, ineffective camera view where you can use the mouse and up key to move. Pressing shift in this mode returns you to level building mode.

The problem is that in 'camera mode' the fps on my computer is low if you navigate the basic level you have just made. Is this something to do with the fact that there are lots of objects on the screen and that the floor and walls of the level you make are made up of several different objects? Or is it just the laptop I am using?

Basic editor code:


X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 14th Aug 2007 17:22
remove your (wait 200)

You can do it if you try
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 14th Aug 2007 18:56
The WAIT command is ok as it is just a pause whilst swapping between the two modes.

The biggest problem is that when you press a key to create a wall or floor it is creating loads of objects all at the same place, so if you hold down 'w' for instance to create an upper wall, you could actually be creating hundreds of walls.

Simplest way is to change code to;



so that after creating a segment, program waits for you to release key.

If you write out 'obj' in your loop you will now find you only get one object created per keypress.

Boo!
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 14th Aug 2007 20:13 Edited at: 15th Aug 2007 05:33
Try this.

Login to post a reply

Server time is: 2024-11-26 11:32:26
Your offset time is: 2024-11-26 11:32:26