Dog Adventures production process (first day control 3d model movement)

Source: Internet
Author: User

Turn http://blog.csdn.net/games_maker/article/details/43953879

Whim, ready to write a little game to play Ha,

The first smallpox took about 20 minutes, and did the following effect

Visit the website to run Http://www.feekood.com/?path=:/tiantian/KeyMove/MoveDog.ais directly

Control the movement of the dog by pressing up or down (the camera follows the dog)

Sign up for Www.wooyoogame.com's account, and then go to http://www.wooyoogame.com/resource/5373 using your dog's model resources.

Clear (); LoadImage ("Floorimg", ":/samples/images/floor.png");//Read platform built-in image resource Createmipmap ("floorimg", 16);//create mipmap picture created ( {type: "box", Width:100,height:0.01,length:100,texture: "Floorimg", Isautotexcoord:true,simplerstate: "Wrap"}); /Create a ground Mesh=includeaisx (":/wooyoo/window7/pug.aisx");//Read Wooyoo platform Dog's model resources//Dog action support has//"Run,stand,stand1,stand2, Stand3,walk,stand4,attackunarmed,combatwound,death, "//create a fixed-angle camera Setcamera (camera={position:{0,5,-5}, target:{ 0,0,0}, up:{0,0,1}, Allowvrotation:false; Turn off the mouse transverse rotation allowhrotation:false; Turn off the mouse vertical rotation allowzoom:false;    Close mouse Middle Zoom});//Set the configuration information for the dog mydog={Action: "Stand";    rotation:0;    x:0;    y:0;    z:0;        The change in the X-coordinate of the dog is the lens change (lens tracking dog) x:-> {camera.position={owner.x,5,owner.z-5};    CAMERA.TARGET={OWNER.X,0,OWNER.Z};    };        Changes in the Z-coordinate of the dog (Lens tracking dog) z:-> {camera.position={owner.x,5,owner.z-5};    CAMERA.TARGET={OWNER.X,0,OWNER.Z};        }; Doing: "Stand";//Custom properties, dog action movespeed:0;//custom properties, dog action rotateanim:0;//custom properties, dog rotation angle target lastrotateanim:0;//custom properties, dog the last time you saved the rotation angle//rotation angle target changes, then dynamic to change the display angle of the dog model rotateanim:->        {owner.rotatesin=sign (Owner.lastrotateanim-owner.rotateanim);        Owner.rotateoff=abs (Owner.lastrotateanim-owner.rotateanim); Case (owner.rotateoff<=180, {owner.        rotation<:{owner.lastrotateanim,owner.rotateanim,300}; }, {owner. Rotation<:{owner.lastrotateanim, owner.lastrotateanim+owner.rotatesin* (owner.rotateoff-180),, 300        };        });    Owner.lastrotateanim=owner.rotateanim;    }; Each frame updates the built-in properties and controls the dog's model skeletal animation isupdated:=> {Owner.movespeed=sys () according to the changes in the doing property.        usedtime/1000; Case (owner.doing== "stand", {owner.                    Action= "Stand"; },owner.doing== "Goup", {owner.            action= "Walk";            owner.rotateanim=0; Owner.        Z+=owner.movespeed; },owner.doing== "Godown", {owner. Action= "Walk";            owner.rotateanim=180; Owner.        Z-=owner.movespeed; },owner.doing== "Goleft", {owner.            action= "Walk";            owner.rotateanim=90; Owner.        X+=owner.movespeed; },owner.doing== "GoRight", {owner.            action= "Walk";            owner.rotateanim=270; Owner.        X-=owner.movespeed;    }); };}::mesh;//Creating a Dog instance create (Mydog);//define key event information keyinfo={id:0;//event number [built-in property] key: "";//key content [built-in properties] iskeydown:false;//Press Next event [built-in event] iskeyup:false;//button Bounce Event [built-in event]//define event trigger, press key to run expression iskeydown:=> {//press and hold the dog's action CA SE (owner.key== "Up", mydog.doing= "Goup", owner.key== "off", mydog.doing= "Godown", owner.key== "left", MyD    Og.doing= "Goleft", owner.key== "right", mydog.doing= "GoRight");    };        Define the event trigger, and the button will run the expression iskeyup:=> {mydog.frame=0;    Mydog.doing= "Stand"; };}; Keyreceive (keyInfo);//Accept the key message

Dog Adventures production process (first day control 3d model movement)

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.