In the tutorial about how to create a Pong-style game, there were lots of "monster" elements being placed around the edge of the screen. A long winded, and tiring, process. However if you read the tutorial about hiding ticks and crosses in a quiz it becomes obvious that you can set up a Pong style activity with only 4 monster elements needed around the edge of the screen.
For each element (remember to take them from the top of the column) use _root.s2, _root.s3, _root.s4 and _root.s5 and define their height and width on the green triangle code screen. That way one monster element will run all the way along the screen or up the screen.
Each element would need code that looked something like this;
_root.s2._width=600;
_root.s2._height=1;
(for a horizontal element) or
_root.s2._width=1;
_root.s2._height=400;
(for a vertical element)
Simple - and it would have saved so much time when creating the Pong activity (and the Popcorn Pinball activity too). You live, learn and discover!
Additional: However after setting up an activity using this idea, the collision detection seems to remain the original size (ie the original square), and doesn't work all the way across / up the screen. Time to think about this one further...
Recent Comments