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 / why is this so slow?

Author
Message
Hunter H111
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location: United States
Posted: 29th Jun 2007 21:12
Why does the ship move so slow?

please help

Attachments

Login to view attachments
B d0t T
18
Years of Service
User Offline
Joined: 23rd Nov 2006
Location:
Posted: 30th Jun 2007 01:02
Just to let you know that i have tested this code on my computer and its slow for me as well. I don't know how to fix it, try increasing the sync rate?

im not good at this dark basic stuff
B d0t T
18
Years of Service
User Offline
Joined: 23rd Nov 2006
Location:
Posted: 30th Jun 2007 01:04
Ok ive done a bit of thinking, ive just seen the biggest problem! You are repeating the load image command, so the program has to load the image 100's of times a secound, try using my version of your code:

sync on

load image "Image 2.bmp", 1
set image colorkey 0,255,0
sprite 1,200,200,1
set sprite priority 1,1
scale sprite 1,30

do
hide mouse

sprite 1,mousex(),mousey(),1

sync
loop

im not good at this dark basic stuff
Hunter H111
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location: United States
Posted: 30th Jun 2007 03:35
Thank you so much
Hunter H111
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location: United States
Posted: 30th Jun 2007 03:49
thanks but the set image colorkey no longer works

sory for asking alot of anoying questions
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 30th Jun 2007 09:36
SET IMAGE COLORKEY must be used *before* you load any images.



...should work fine =)

Cheers,
Bishop


Tux is my guildmaster.
B d0t T
18
Years of Service
User Offline
Joined: 23rd Nov 2006
Location:
Posted: 30th Jun 2007 10:19
O yeah soz forgot about that command :s

im not good at this dark basic stuff
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 30th Jun 2007 17:38
It doesn't make any sense to hide the mouse from within your main loop. Hide it before the loop. You should only have the code moving sprite 1 (the ship) in the do - loop.

LB
Hunter H111
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location: United States
Posted: 30th Jun 2007 20:02
thank you every one
Aralox
17
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 5th Jul 2007 10:36
btw, why dont you just hide the mouse at the start instead of looping it along with everything else?


revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 10th Jul 2007 10:15
basically Hunter, you put all of the code to setup the program at the beginning of your code, anything that only needs to be done once, such as loading images, sounds, models, shaders, setting up arrays, loading the environment, etc.., and within the loop, only type code to modify the current state of the all ready setup program, such as moving the character, looking around, attacking, playing sounds, displaying images, ect... you really want to anything that takes a while before the game starts (as in a loading screen). Loading files takes longer than displaying the pre-loaded file. I hope this makes sense.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 10th Jul 2007 19:43
That shouldn't even compile, you're loading the same image ID multiple times. You should be getting an "image already exists" error.


Login to post a reply

Server time is: 2024-11-25 15:14:13
Your offset time is: 2024-11-25 15:14:13