1 / 5

Intro to Action Script 5

Create an interactive animation dice game with two dice and a "roll" button. Each dice displays a random number from 1 to 6 when the button is clicked. If both dice show the same number, the color of the dice changes and a song is played. Each roll changes the color of the dice and plays a different song.

hamill
Download Presentation

Intro to Action Script 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. "The games of a people reveal a great deal about them.“ Marshall McLuhan Intro to Action Script 5

  2. Create an interactive animation dice game with two dice and button “roll” to through them. Each dice has to display random number from 1 to 6 each time the button “roll” is clicked. If both dice show the same number, change the color property of each dice and play a song. Play randomly selected songs each time dice show the same number. Change each dice color on each roll. Play different song for each roll. Exercise – dice

  3. myObjectColor = new Color(“movieclip_name") ; myObjectColor.setRGB(0xFFFFFF); Exercise – dice

  4. on (release) { // make list of possible responses responses = new Array("1", "2", "3", "4", "5", "6" ); // get number of responses n = responses.length; // pick random response r = Int(Math.random()*n); f = Int(Math.random()*n); // place response in text area dice1 = responses[r]; dice2 = responses[f]; dice1Color = new Color("dice1"); dice1Color.setRGB(0xFFFFFF); dice2Color = new Color("dice2"); dice2Color.setRGB(0xFFFFFF); Exercise – dice

  5. if(r==f) { dice1Color.setRGB(0xFF0000); dice2Color.setRGB(0xFF0000); } // start animation gotoAndPlay(2); } Exercise – dice

More Related