answersLogoWhite

0


Best Answer

It depends how you want to do it. For a basic text counter it's very easy. First setup a global variable in the initialization of your code: global pCounter = 0 In the portion of your code where you detect that the player has scored, simply increment the counter by an appropriate value: pCounter = pCounter + 1 Then to display it on the screen (in this example, the upper left hand corner), simply use a text command: text 10,10,STR$(pCounter) The two 10's are specifying the number of pixels in the X and Y direction away from the upper left corner where the text should be put and the STR$(...) around the pCounter variable is used to turn it into a string. To make a graphical score counter for a 3D game, here are some functions you can use: function SetupCounter() for i=100 to 109 : load image STR$(i-100)+".jpg",i : next i X# = 3 // if you're using a widescreen resolution, set to 3.6 for n=60 to 64

make object plain n,.2,.2

position object n,X#,2.2,4

lock object on n

texture object n,100

ghost object on n

set object light n,0

dec X#,.2

next n global PlayerScore = 0 endfunction function ControlScore()

score$ = STR$(PlayerScore)

length = len(score$) texture object 60,100+val(mid$(score$,length)) if length>1 then texture object 61,100+val(mid$(score$,length-1))

if length>2 then texture object 62,100+val(mid$(score$,length-2))

if length>3 then texture object 63,100+val(mid$(score$,length-3))

if length>4 then texture object 64,100+val(mid$(score$,length-4))

endfunction Here's how you can use it: 1. Create ten 80x80 JPEG images with the numbers 0-9 surrounded by black called "1.jpg", "2.jpg", etc. and put them in the same directory as your code. 2. Copy and paste the above functions in your code. 3. In the initialization part of your code, call SetupCounter() 4. Whenever the player scores, increment the PlayerScore variable appropriately. 4. Then in the main loop of your code, call ControlScore() This will create a four digit score counter with transparent numbers in the upper right corner of the screen. Make sure you don't have any other objects with ID numbers 61-64 or image numbers from 100-109

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you make a point counter for your DarkBasic Pro game?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can and if so How do you make a point counter on power point 2003 for jeopardy?

I do no think that you can create a point counter on Microsoft 2003 version. It wouldn't work for me, so it probably won't work for you.


When writing an argument essay it's best to avoid the opposing point of view?

No you should add it just make sure you can counter it. You want to make sure you got every opposing point of view in there and counter it. So there is no doubt that your right about what your talking about.


How do you make a server in counter strike 1.6?

I think you have to press New Game and I think that's the new game in the list.


Who can make point in badminton game?

The Server


How do you get rid of the radio commands in counter strike source?

Go and make a game, and go to the bot options and you can make it none.


How do you make a Sonic game with Game Maker 7 lite?

With any game creating software wether it is Game Maker 7 lite, Multimedia fusion 2 or Darkbasic Professional, the only way to make a game you want is to Practice the tools in that creator. Use the Tutorials and Help files, Look up Example games, Try making your own small examples, look for what you can improve on, if you get stuck try a different way. In the end to make any game it takes Skill,Artistic ability and patients. Dont expect to make full finished game in a few days. Start off smaller then work your way up.


Has there been total 100 point game?

No, make sense.


How do you handle conflict in which someone uses the quiet game to make a point instead of discussing the issue as a rational human being?

You can try writing them a letter Discussing all of the points tht you have and than include counter attacks of why they might be mad


How do you make a Pokemon game without rom hacking?

By using Game creating software and learning to program. Try out a programming software called Multimedia fusion 2 it is user friendly and requires no actual Coding and its easy for 2d games. If you are looking for 3d games Try Darkbasic Professional. If you are looking to make games for the Nintendo DS then look up Nintendo DS Home brew and Dev kits, just search for each item on google.


How do you connect multiplayer in game counter strike?

You select online multiplayer make sure you are connected to the internet and you can search for servers to play on.


How do you make the fan go up on Game Show Island?

point it down


Can you lose a tennis game if you make a double fault?

The answer is no you cant. But you will lose that point.