Silverlight game design: (7) create a new game demo Based on the scenario editor

Source: Internet
Author: User

The scenario editor is powerful and flexible. From the very beginning of its design, I have clearly positioned it to the height of "making Silverlight game scenario setup simpler and faster. After the source code is published, many friends are eager to know how to apply it to actual game production. In fact, in order to make it easier for everyone to master the architecture principles and applications of this editor, I have already planned to explain a large number of classic game demos based on this scenario editor in subsequent tutorials, for example, "three National Policies", "Legend of the legend of the fairy sword", "Fantasy simulation war", "the age of the Empire", and so on. In this section, I shoulder an arduous mission to teach you how to use vs2008 to modify the Scenario Editor and create a brand new one, you can use the Silverlight game demo named by yourself. Is it a bit exciting? Hurry up ~

The first step is to determine the name of the new game. To facilitate your practice, call it newgame.

OK. Next, open vs2008 and choose File> open> Project/solution> qxsceneeditor in the source code of the scenario editor. SLN and open it. Then, in Solution Explorer, select solution qxsceneeditor, qxsceneeditor, and qxsceneeditor. tools, qxsceneeditor. right-click the four web nodes and choose "solution newgame", "newgame", and "newgame. tools, newgame. web ":


Step 2: press Ctrl + F, switch to the quick replace tab, and replace "qxsceneeditor" with "newgame ", set the search range to "entire solution" to replace all names in the project:

Change the folder qxsceneeditorresource that saves all Silverlight program images in the newgame. Web project to newgameresource:

Step 3: Select "qxsceneeditor" and "qxsceneeditor. tools, qxsceneeditor. right-click the three web nodes and choose "> Properties" to replace all "qxsceneeditor" with "newgame ":

Step 4: press Ctrl + Shift + B to compile the entire solution. If you have carefully compiled the solution by in the above steps, the compilation will succeed.

Step 5: click File> close solution. Next, find the qxsceneeditor folder where the program is located, and set "qxsceneeditor" and "qxsceneeditor. tools, qxsceneeditor. the three web folders are renamed as "newgame" and "newgame. tools, newgame. web ":

Step 6: Open newgame. sln in notepad and replace the three "qxsceneeditor" with "newgame" so that newgame. sln can recognize and start the above three projects:

Finally, we open this brand new newgame. sln again through vs2008, press Ctrl + F5, hey, run the next game to see it ~ Just a few minutes later, a game framework of your own was born ~

Some people have made comments: in fact, we can create a new Silverlight project and add the materials, classes, files, and other resources in the scenario editor project to the project one by one, this may be simpler. Of course, if there are few resources in the source solution, the structure is simple and feasible. However, if the source solution contains N more materials, in addition, there is a complex relationship between projects or within the project. Using this method can easily lead to compilation of a large number of errors and get twice the result with half the effort. Through the explanation in this article, I hope that you will not only learn how to modify it, but also be able to understand what else it means: If you can easily drive a native Silverlight project and deeply understand the relationship between projects, and how they were started, connected, and finally seamlessly integrated and perfectly collaborated, this reached the ultimate goal of this article.

Speaking of this, I especially want to explain to some new friends who are new to Silverlight about the resources in the project. Some people have always asked me: I just replaced the material image in the source code, but I haven't modified any code, but why can't I show new images at runtime? Here, I want to emphasize that adding a new object to the Silverlight Project (note, not a WEB Project), such as adding a new image, you must right-click the project, such as the images folder, and choose add from the shortcut menu to create an item or an existing item:

You can also click "show all files" to include the corresponding files in the folder in the project:

Instead, you cannot directly paste or replace the file to the project folder through "my computer" because the project cannot identify resource operations performed outside of the project. Remember!

Everything is ready. Are you ready? New games have become in your hands; in your heart, the long-awaited passion is time to release. Who is the next master ?!!!

Online Demo address: http://cangod.com

Author: dark blue right hand
Source: http://alamiye010.cnblogs.com/
Download the tutorial directory and source code: Click to enter (welcome to join the WPF/Silverlight team WPF/Silverlight blog Team)
The copyright of this article is shared by the author and the blog Park. You are welcome to reprint it. However, this statement must be retained without the author's consent and the original article connection should be provided in a prominent position on the article page; otherwise, the right to pursue legal liability will be retained.

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.