Saturday, June 30, 2018

Next Project: Idea Generator!

Here's the next project. How to make a generator that prints out six game elements  at random that I can use to create my games. 

Here's how it will work:

1. Put a text field on the first frame or second frame and fill it with text.

2. Create an array (or a vector). Create a second one for the result

3. for (var i:int=0; i<5;i++) {
result.push(array.pop(floor(Math.random()*array.length));
}

4. resultField.text = (result+ ", Buttons.");

Also, I'm going to add another element. This one will be creating a pointer. I've done this once before. A pointer is a sprite that pivots and rotates to point at another object, traditionally a mouse pointer. It's going to be fun adding this into the mix. I can't wait to see what's coming up next!

No comments:

Post a Comment