LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a recorded Scoreboard + Final touches to a game

Hi,

I'm fairly new to labview. I've made a maze game where you have to control the character to get to the treasure, whilst avoiding the enemies.

 

I wanted to make a timer that showed up above the game and would show you how long it took you to get to the treasure, whilst also ending the game if you went over 15 seconds. I managed to make one before but when I reset the game, the timer didnt start at 0 again. I think it reset as soon as the game was over, so when I went through the options  to play again, it was already on ~3-6 seconds.

 

Also I want to make a scoreboard, so depending on how long you took, a score would be generated. I will use the timer to generate a score, but I want a visible scoreboard to show next to the game where you can enter your name and you get a score with rankings 1-10.

 

Finally for the maps, I have a random selection of 5 maps. But everytime you run the game, it asks for the path input of the maps. Is there anyway to make it so that it automatically chooses the path of the maps, even if I close the game and send it to someone else?

 

I know that my Project is messy with wires going all over the place, but once again I am new to labview and I don't know any shortcuts or anything. I've been trying to make it tidier as I went along from suggestions from people like using sub-vi's. To begin with I had everything on a single screen!!

 

Thanks for the help.

0 Kudos
Message 1 of 2
(3,393 Views)

I'm using LabVIEW 2014, so I cannot view your project, but here are some tips.


I wanted to make a timer that showed up above the game and would show you how long it took you to get to the treasure, whilst also ending the game if you went over 15 seconds. I managed to make one before but when I reset the game, the timer didnt start at 0 again. I think it reset as soon as the game was over, so when I went through the options  to play again, it was already on ~3-6 seconds.

Make the first step of starting the game to reset the timer, not the last.


Also I want to make a scoreboard, so depending on how long you took, a score would be generated. I will use the timer to generate a score, but I want a visible scoreboard to show next to the game where you can enter your name and you get a score with rankings 1-10.


If you want a running scoreboard (that saves even when the game is closed) you will have to write to a file. The most common is probably a .ini file, here is a tutorial on using config files:

http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/creating_configuration_files/

 


 

Finally for the maps, I have a random selection of 5 maps. But everytime you run the game, it asks for the path input of the maps. Is there anyway to make it so that it automatically chooses the path of the maps, even if I close the game and send it to someone else?


 

If you store your maps in a folder called "Maps" that is located right next to your application, you can use a method like this. You will have to put the proper extension at the end of your file names, and the exact way you build the path might depend on your operating system (I'm using Windows 7).

Random Map.png

 


 

I know that my Project is messy with wires going all over the place, but once again I am new to labview and I don't know any shortcuts or anything. I've been trying to make it tidier as I went along from suggestions from people like using sub-vi's. To begin with I had everything on a single screen!!

 

Thanks for the help.


 

As I said I could not view your project, but good job for trying to make changes based on the suggestions here. The less personally you take the critique, the better your skills will be!

 

0 Kudos
Message 2 of 2
(3,373 Views)