Very very basic action scripting

  • Thread starter brandy
  • Start date
You can adjust this number to your desired frame rate. In summary, to create your game using Macromedia Flash, you need to utilize the Math.random function to randomize the appearance of the butterflies, change the mouse's appearance to a net using the MouseCursor class, and adjust the frame rate using the setFPS() method of the Stage class. These will help you complete the game according to your classmate's specifications. Any additional help can be appreciated.
  • #1
brandy
161
0
i know very limited action script but i need to make this game using macromedia flash for my computer studies class. its a gay idea i know but a little grade 2'er had to select people from my class to make them a game according to their specifications, mine happened to be a very girly girl. anyway you click on the butterfly with the mouse to catch it with a net. you have to catch as many before the timer runs out. iv figured out the code for scoring and have got the basic idea for the butterflys. i plan on using the math.random function to randomise the appearance of butterflys but i need a little help with translating the number into a position. I also need help with changing the mouse into a net on screen.

so in summary

problem 1: Utilising the math.random function to randomise appearance of the butterflies. like a timed one.

problem 2: how would i change the mouse to appear on the screen as a net that i drew on flash?

problem 3: what would be the code for changing the frames rate

any help is appreciated.d
please and thank you :P
 
Physics news on Phys.org
  • #2
Problem 1: To use the Math.random function to randomize the appearance of the butterflies, you can use a looping structure such as a for loop to move the butterflies around on the screen. The Math.random function will generate a random number between 0 and 1 each time it is called, so you can use this number to set the butterfly's X and Y coordinates. For example: for(var i=0;i<numButterflies;i++) { var randX = Math.random()*stage.width; var randY = Math.random()*stage.height; butterfly.x = randX; butterfly.y = randY; } This code will create a loop that runs numButterflies times, and each time it will assign the butterfly a new random X and Y position based on the stage width and height.Problem 2: To change the mouse's appearance to a net, you can use the MouseCursor class. You can set the cursor to a custom image or symbol by using the setCursor() method. For example: Mouse.setCursor(netImage); Where netImage is the image or symbol of your net that you have created in Flash.Problem 3: To change the frame rate of the game, you can use the setFPS() method of the Stage class. For example: Stage.setFPS(30); This will set the frame rate of the game to 30 frames per second.
 
  • #3


I am not an expert in action scripting or Macromedia Flash. However, I can offer some general advice and suggestions that may help you with your project.

First of all, it's great that you have a basic understanding of action scripting and have already figured out the code for scoring and the basic idea for the butterflies. This shows that you are making progress and have a good understanding of the fundamentals.

For your first problem, utilizing the math.random function to randomize the appearance of the butterflies, you can use the "setInterval" function to create a timed event that will trigger the appearance of the butterflies. You can also use the "gotoAndStop" function to change the frames of the butterflies to make it appear as if they are moving.

As for your second problem, changing the mouse to appear on the screen as a net, you can use the "Mouse.hide" function to hide the default mouse cursor and then create a new movie clip of the net that will follow the mouse movements. You can also use the "onPress" and "onRelease" functions to make the net appear when the mouse is clicked and disappear when it is released.

Lastly, for changing the frame rate, you can use the "FrameRate" function to set the desired frame rate for your game. Keep in mind that a higher frame rate may make the game run smoother, but it can also make it more demanding on the computer's resources.

Overall, my advice is to do some research and look for tutorials or examples of similar games that use action scripting and Macromedia Flash. This will give you a better understanding of the coding and techniques used to create games like yours. Also, don't be afraid to ask for help from your classmates or your teacher, as they may have more experience with this type of project.

Good luck with your game!
 

1. What is action scripting?

Action scripting is a programming language used to create interactive elements in Adobe Flash. It allows for the creation of animations, games, and other multimedia content.

2. Is action scripting difficult to learn?

It depends on your level of experience with programming. If you are new to programming, it may take some time to learn the basics of action scripting. However, with practice and dedication, it can become easier to understand and use.

3. Can I use action scripting for web development?

Yes, action scripting can be used for web development. It is often used in combination with HTML, CSS, and other web technologies to create interactive and animated content on websites.

4. Do I need special software to write and run action scripting?

Yes, you will need Adobe Flash or another program that supports action scripting in order to write and run your code. These programs provide a development environment and a preview option to see how your code will work.

5. What are some common uses for action scripting?

Action scripting is commonly used to create interactive games, animations, and advertisements. It can also be used for creating dynamic and interactive elements on websites, such as menus, buttons, and forms.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
15
Views
1K
  • New Member Introductions
Replies
1
Views
137
Replies
2
Views
850
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
Replies
16
Views
1K
  • Programming and Computer Science
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
Back
Top