Use Popfly GameCreator to easily build a Silverlight game-Part2 (final)

Source: Internet
Author: User
Use Popfly GameCreator to easily build a Silverlight game-Part2 (final)

Abstract: This article describes how to use Microsoft Popfly Gamecreator to easily build custom silverlight games. This article describes how to create a non-player and win-win scenario, Have fun!

Keywords

Microsoft Popfly, Silverlight, Game

The previous article introduced how to build a game similar to space shooter and completed some control work on the player's spacecraft. Now we have the following scenarios:

Next, we need to make some processing for those flying saucer with no behavior above. Click the Actor button, select the UFO on the right, and then click "behavior ". On the left side of the pop-up box, select "motion". Then, a column named "Motion1" is added to the editing area. Then, click the Motion button of Motion1:

In the dialog box, select the right (E) Direction (you can select either the left or the right ). Set For distance to around 140 to 150. This value reflects the moving range between the left and right sides of the UFO. Then I did not select Reverce When Done and Repeat forever under For Distance. in this way, the ship can continue to round-trip. You can click "Preview" to Preview the screen. Do not forget to click the Preview screen to ensure that it gets the focus.
Er, but it will only be left and right, and no attack power is too weak. Now we are also going to add the shooting behavior for the enemy UFO. In the cast table, select an enemy UFO and click Behavior --> Shoot. This is a shoot1 column added:

Then we click the shoot1 event, and click timer to set the random occurrence (shooting) behavior to 5 to 20 seconds:

Then, click Projectile of shoot1 to select the bullet style, set the downward (S) Direction for the bullet relative Scene (Scene) in shoot1 motion, and then click sound to select the sound, this is similar to when we set the player's bullets.
It seems that everything is okay. You can preview it first. Soon you will find the BUG. At this time, the UFO disappears one by one as they open fire, this is because we have not "installed eyes" for their bullets ". They were killed by their own bullets. Now let's fix this BUG,
First, we should select the UFO bullet in the "cast table:

Click its Behavior below. The following dialog box is displayed:

Select the "event" button in the DisappearOnCollision column, and then select "raising this event when Solides collide" in the pop-up dialog box (click the second one, do not select myself ):

The following dialog box is displayed:

Then we select "Any instance of (player's ship. OK. Save it. Now it is basically playable.

To improve the game, we also need to add a scenario after the game wins or fails.
Click the scenes icon in the upper left corner:

Click Behaviors --> select Scene on the left side of the pop-up dialog box. The column "SceneChange1" is added to the editing area as follows:

Select the above envent button, Select Property Change in the pop-up dialog box, and then click the Game button in:

In the displayed dialog box, select A Scene ---> Select Main ---> and click "X" to close the dialog box.
Then, set the two drop-down boxes of SceneChange1 to the following:

Here, "Flying saucer" is the name of the selected enemy ship. This setting indicates that the event is triggered when the enemy plane is 0 in the home scene.
Then select Scene in SceneChange1 and select Won. In this way, the scenario of victory is set up.

Next is the failure scenario. Similar to the above scenario, click Actor, find the player's ship in the "cast table" on the right, and click Behaviors --> click Scene, at this time, a SceneChange1 topic is added to the player's ship. Click the event of SceneChange1 and change Load to disappear in Simply ,:

Close the "Choose an event" dialog box, click the Scene button of eventchange1, and select the Lost icon:

Okay. Basically, there is still the last step. Our ship has a default "DisappearOnSceneLeave", which means it will automatically disappear when the player's ship leaves the current scene, we 'd better drop this "X" and click "X" in front of it.
OK. You can enjoy this customized game!
Finally, I wish all friends aged 14-28 happy youth festival! Give yourself a holiday and have a rest when you play games!
The first very weak Sample I made here: http://www.popfly.com/users/fox23/Freesc1
Have fun!

Yellow winter

PS: There are still a lot of bugs in the alpha version (which deserves improvement in some logic and scenario switching). However, it's pretty cool ~

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.