WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-27-2010, 12:42 PM
jaffaaswami jaffaaswami is offline
Member
 
Join Date: Oct 2010
Posts: 5
Screen label and input

Hi friends,

Hope you are all doing great. I was trying to go through the world demos available in the help menu. I have found two interesting things there

1) I want to know the process by which we can constraint the score board in duck court game. The score keeps on incrementing by 1 whenever you hit a duck with the ball. If I have to constraint that to 10 and then print a message saying "congratulations U have won! ", how do I go ahead with that ?

2) If I have to provide an option to the user to select the speed of the ball dynamically on the screen instead of changing it in the code statically, What changes should I make to the code.


Please provide me the code so that I can implement it and make necessary changes. All of you have been very helpful to beginners like me. Thanks a lot for your cooperation.

Regards,
Swami
Reply With Quote
  #2  
Old 10-27-2010, 04:37 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
1. Theres a variable called scoreLabel.score that it incremented in the onCollide function. When that is equal to 10 you can change the scoreLabel message to say congratulations.

2. You can change the ball speed after a GUI event occurs. For example, if you are using a slider, once the slider position is changed you could get it's position and base the speed on that. The documentation has examples of using GUI objects and handling GUI events.
Reply With Quote
  #3  
Old 10-29-2010, 03:22 PM
jaffaaswami jaffaaswami is offline
Member
 
Join Date: Oct 2010
Posts: 5
Smile Hi Jeff

Hi Jeff,

I was successful in changing the message to 'congrats' after reaching a target score. But how to end the game... I mean how to disable the onscreen events after that particular target is reached ? Another question is the slider thing didnt work at all with all the possible combinations... can u help me out on this... The tutorial didnt work for me....

In the duck game if I have to randomly make the ducks move in both left and right directions what changes should I make to the code.. I am stuck with it... Hope u understand...

THanks
Swami
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC