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.

DarkBASIC Professional Discussion / Efficiency Questions

Author
Message
Purplepickle
15
Years of Service
User Offline
Joined: 4th Jun 2011
Location: Between hopeless and needs improvement..
Posted: 8th Sep 2011 02:50 Edited at: 8th Sep 2011 02:52
Hello again I have a few questions about how to make a script run faster.
One I have a mini movie that turns into the menu. It is made of a repeating code that makes the letters fall and change colors.

And by changing the coords I can make the letters move, my question : Is it faster for DBPro as a 1000 line code or as a vidoe clip?

Secondly is there a way to use a for loop for this?

I know there is a way to do this with a for loop using somthing like.


Note: Can you please show me on my code...When you guys go above and beyond it is very hard for me to understand.
Thanks for all the help!
Edit: The spacing was very weird

Wait, what?
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 8th Sep 2011 05:02
In answer to your first question, it'd be faster to run it through code in terms of efficiency, but depending on what else your program needs to do, it would be comparable to just load in a movie, depending on the movie size/format.

In answer to your second question, you need to include more information. What is the desired effect of your program?

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Webber
15
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 8th Sep 2011 07:10
Question 1
Well as for making a program run faster, its best to test that on your own, cause most of the time the speed of a program is unpredictable.
So basically, it depends on the lines of code, and the video clip, or other media that is used.



Question 2
Arrays are cool

I'm not sure what the desired effect of your program is, but...
For Loop simplification code stuff


For Loop simplification code stuff simplified even more, but some of the code is not in the same order.


Hope that this helps, I didn't test it.



And remember the derivative of e to the x is e to the x.

I like games, and stuff.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Sep 2011 14:15
Quote: "I have a mini movie that turns into the menu...Is it faster for DBPro as a 1000 line code or as a video clip?"


If it's a menu, then you need to ask whether it really matters? Menus tend not to be time-critical, they are waiting for user interaction, the user being 1000s of times slower then the PC. You might be better spending time and effort on more critical issues.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Sep 2011 15:14 Edited at: 8th Sep 2011 16:05
Hi there
@Purplepickle
Instead of :

Quote: "If ax# > x# then ax# = ax#-.2
If ax# < x# then ax# = ax#+.2"


You could get last x#,y# position of your sprites and restore when you need it.






Edited

Another example with a bucle .




Cheers.

I'm not a grumpy grandpa
Purplepickle
15
Years of Service
User Offline
Joined: 4th Jun 2011
Location: Between hopeless and needs improvement..
Posted: 9th Sep 2011 01:54
Thanks I completely understand but the enemies a bunched up and the "inter-enemie" collision system isn't working. I'm getting a runtime error 128, Out of bounds.






Wait, what?

Login to post a reply

Server time is: 2026-07-11 04:44:24
Your offset time is: 2026-07-11 04:44:24