Control the genie with the mouse and control the genie with the mouse

Source: Internet
Author: User

Control the genie with the mouse and control the genie with the mouse
Control the genie with the mouse

We registered a user in the http://www.wooyoogame.com and then at http://www.feekood.com/you can access the development environment, personal recommendations use a Google browser.
To put it bluntly, how can we control the basic operations of an Genie With the mouse today.
The following is the script code I wrote. The comments are detailed. You can copy my script, click "new", and paste it in, click "execute" to see the effect,

I will answer this question if I don't know how to reply to the post.


// Title: control the genie with the mouse // Author: xiao'er Sprite ={// create an object Type: "Sprite"; // create it as Genie X: 10%; // set the X position Y: 10%; // set the Y position Height: 15%; // set the Height Width: 15%; // set the broadband CenterX: 50%; // set center X position CenterY: 50%; // set center Y position Rotation: 0; // set Rotation Degree Shader: // set special effect {Type: "color "; // Color effect Color: {, 1}; // Color attribute };}; create (Sprite); // create the Sprite object mouseInfo = {IsMouseDown: false; // press the left mouse button to press [built-in events] IsMouseUp: false; // the left mouse button pops up [built-in events] IsMouseMove: false; // move the mouse to [built-in events] IsWheelUp: false; // scroll up with the mouse wheel [built-in events] IsWheelDown: false; // scroll down with the mouse wheel [built-in events] MouseX: 0; // The x coordinate of the mouse screen [built-in attribute] MouseY: 0; // The y coordinate of the mouse screen [built-in attribute] IsMouseMove: => // trigger {Sprite. X = owner. mouseX; // change the Sprite position. Y = owner. mouseY ;}; IsMouseDown :=> // trigger {Sprite. shader. color = {rand (), rand (), rand ()}; // set a random color}; IsWheelDown: => // trigger {Sprite. rotation + = 10; // change the Rotation Degree of the genie}; IsWheelUp: => // trigger when the scroll wheel is scroll up {Sprite. rotation-= 10; // change the Rotation Degree of the genie}; MouseReceive (mouseInfo); // create a mouseInfo variable and accept it as a mouse event
 




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.