Game Development Reference
In-Depth Information
Tip
Custom or standard events can be dispatched using the
dispatchEvent
function. This can be
used to simulate touch events, as in a tutorial. So, the data can be read and saved in an array or table,
which can then be passed to simulate the user interacting with the app.
Animations
Gideros Studio offers the
MovieClip
class for creating animations. It allows for creating frames and
the animation plays based on these frames. Here's a code example:
{1, 100, sprite, {x = {0, 200, "linear"}}}}
play
function. The animation starts to play automatically as soon
This could, for example, be used to create and play animations infinitely, as in the following example:
mc:setGotoAction(100, 1)
This command indicates that on reaching the 100th frame, the movie clip will loop back to the
first.
Similar to
gotoAction
, you can set
stopAction
, which stops the animation when a certain frame
is reached; this can be used to split the animation into multiple parts. You can stop the activity of
gotoAction
and
stopAction
by using the
clearAction
function. Similarly, there are the
gotoAndPlay
and the
gotoAndStop
function which start playing from the frame specified in
gotoAndPlay
or stop at
the frame specified in
gotoAndStop
.
Networking and the Internet
In your game, you might want to open a link to your web site, or upload or download some data. In
other cases, you might want to send an e-mail or dial a phone number. This section will describe
how to do these things.
The simplest way to navigate to a site is by using the function
application:openUrl(THE_URL)
where
the URL can be any of the following
http:
,
https:
,
tel:
and
mailto: