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.

Author
Message
Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 3rd Jul 2006 04:07 Edited at: 3rd Jul 2006 04:08
I need some help with the simple line of code to show FPS.
I tried fps$=screen fps
do
print fps$
cls
loop

Getix Interactive and Nanovision. Good Combo.
www.getixinteractive.com
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Jul 2006 07:29 Edited at: 3rd Jul 2006 07:30


Is more efficient and better programming practise. The problems with your method:

1. You defined fps$ as a string and gave it an integer value, that wont work. Instead of fps$ just use fps.

2. You put a cls command after printing the fps, this will erase the screen right after printing it, making the print command useless. Put the cls before the print command instead.

3. You only define fps at the beginning of the program, to get the fps in real-time you must re-define it every loop, move the fps = screen fps inside the loop.

4. You dont have the parenthesis at the end of screen fps, it should be screen fps()

The resulting code:



This will work, but it is extremely sloppy and inefficient. Judging by every single line of your program being in the wrong place or used incorrectly, I suggest you go back to the tutorials, the basic ones first, and read them again.

Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 3rd Jul 2006 07:57
RUCCUS, my game is running fine. I just didn't relize I needed () after screen fps

so now screen fps()



Thx

Getix Interactive and Nanovision. Good Combo.
www.getixinteractive.com
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Jul 2006 16:27
Just adding the parenthesis at the end of screen fps in your example is just fixing one of the many mistakes with the code. Your game might be running fine, but that doesnt mean the code is good.

Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 4th Jul 2006 04:44
You know RUCCUS, there's a reason this is posted in the NEWCOMERS CORNER. And your Domain Name -- Ruccus.net is GONE. If it doesn't work, please remove your WEB address, I had 21 pop-ups, pop up when I went to your site. And excuse my attitude but how the f**k do you know if my code is screwed up? I've never used screen fps() that's no reason to get so pissy... If your so efficient at coding and you don't want to help people in the Newcomers Corner, then get the f**k out.

-Jim

Getix Interactive and Nanovision. Good Combo.
www.getixinteractive.com
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 4th Jul 2006 05:08 Edited at: 4th Jul 2006 05:09
Wow. Lose the attitude kid, apparently we've got another newcommer that cant take critisism, god help us. Yes, this is called the Newcommer's Corner, where guru's and oldbies help newcommers to programming (you). I am helping you to understand the concepts of programming, and to fix your code problems. You're backlashing and being a prick about my help, like many do in their starting stages on forums, so I wont hold it against you.

As far as my site goes, nobody asked you to visit it, I realize it is down, this is mainly due to a business man purchasing it and attempting to sell it back to me for profit. My personal matters have nothing to do with your programming errors, so please dont bring that up again, you'll only make yourself look like a moron in doing so.

I wasnt getting pissy, if you took a second look at my posts they were concise and to the point, not only did I correct your code completely, I also provided a more efficient work-around for the solution to better help you in refining your programing techniques.

I know that your code is inefficient and most likely sloppy based on the layout and style of the code you posted above. You're trying to accomplish pretty much THE first thing newcommer's learn when programming, and are doing so horridly. This can only lead me to believe that any other task you take on must be done 10 times worse using this technique.

I mst agree with you in your closing argument however, I am fairly efficient with my own programming, and am actually quite proud of it. Theres something to be said for making an application accomplish several tasks in a few lines of code, instead of using a lot more lines of code to do the samre thing (as you so kindly demonstrated).

With that said, I wont stop commenting/helping (or being pissy as you'd like to say) you with your problems on these forums, because the more the others and myself teach you the techniques of programming, the less we'll have to deal with crud like this clogging up the forums.

And lastly, dont swear, nobody on these forums appretiates it, even with the use of asterisks.


Im sorry if I displeased you in giving you solid advise instead of being a tool for you to get your answers quickly and in some cases incorrectly, next time Ill be sure to give you the finished code instead, and Ill leave you to undoubtedly make another forum post asking how it works.

My sencere appologies,
- RUCCUS

Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 4th Jul 2006 05:39
Ok, ruccus, I am sorry for "jumping the gun". I just thought that was a little rude assuming my code was inefficient. I bet my code is quite inefficient, but it works. I'm not making a game for a next generation console. If I would, I'd use Visual Studio 2005 along with the latest XNA build all in C+/C#. I would appreciate next time though, to see my entire code before assuming it's inefficient. And I also would appreciate you continuing to help the community.

By the way, my suggestion worked with the fps, which gave me around 100 FPS. Your way gave me a constant 147 FPS. Thanks!

Getix Interactive and Nanovision. Good Combo.
www.getixinteractive.com
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 6th Jul 2006 12:46
One of the things with programming is that it has much to do with do with numbers. If this case, what the command "screen fps()" we all know, but still it returns a value, so if you want to output it on the screen, you dont need to store it in a variable, you just have to print it out directly. Doing so, you make a more effective code. So an advice is to treat many of the commands as if they where numbers, even though that is not the entire truth.

Login to post a reply

Server time is: 2024-11-27 15:38:38
Your offset time is: 2024-11-27 15:38:38