Create random text and show in a shape


#1

I want to choose a random number from 1-25. Then assign text to each number and show that text on the screen. (mimic’s the wheel on “Wheel of Fortune”).


(Mark Hunte) #2

And I want someone to give me a really big house. But that is unlikely to happen without me investing something. :grimacing:

Which is what you really need to do here by showing that you have been working on this yourself rather than just posting an idea.
Posting something to show where you are at would encourage us to help.:wink:


(Jonathan Deutsch) #3

This type of task requires javascript programming. Here’s the basics building blocks:

  • In Hype you can go to the Identity Inspector and set a Unique Element ID that can be used to get at specific elements via the hypeDocument.getElementById() API.
  • Once you get the element, you can adjust the contents by modifying the .innerHTML field.
  • JavaScript has a random number generator.

#4

Thanks for your help!


#5

I have attached my Wheel of Fortune Hype file. I created a timeline for each letter so that when I click on the letter it shows the letters in the puzzle. The empty box to the left of the wheel is for the "text” result of the random wheel text chosen when I click on the wheel. I didn’t create any javascript yet for when I click on the wheel to have the computer pick a random number and then assign that number some text like “$300” or “$1000” or “Bankrupt”, and so forth. I used a macro in Powerpoint to chose a random number and then assign it text, but I would like to use Hype instead.

Wheel of Fortune.hype.zip (395 KB)


#6

Have look at this… hope this code is instructional for you.

WheelOfFortune.hype.zip (68,4 KB)


Game Design Examples (two approaches)