C # development Wpf/silverlight animation and games series Tutorials (Game Tutorial): (41)

Source: Internet
Author: User
Tags silverlight radar

C # development Wpf/silverlight animation and games series Tutorials (Game Tutorial): (41) make exquisite mini map ①

What will it take to endure the thoughts of the next few months? In addition to study or study.

Feeling a turn, hehe. In this section I will explain how to make a nice mini map for Silverlight games. The mini map is divided into two kinds, one is the mini radar (navigation) map which is usually in the upper right corner of the game window, and the other is the Panorama mini map. In this section I will first explain how to make the navigation mini radar map. This kind of map in the game mainly play a role in navigation, that is, lead the protagonist forward direction, and show the protagonist around the various objects, such as: monsters, NPC, transmission points, etc. more, you can also add to the advanced features such as close-distance search.

The first is the design stage, you may wish to look at a picture:

The mini radar Map I made for this tutorial game contains roughly a few features:

1 Show/hide the mini map function. The realization is very simple, just modify the mini radar map of the body to render the area of the visibility can be. But this function plays a great role in adjusting the performance of the whole game. We should all be aware that the mini radar map is almost equivalent to a scaled-down copy of the game window, the elements that it updates and renders are many, especially in the performance-demanding webgame, which forces us to install a switch to control the temporary closure when we don't need to look at the navigation mini map. To stop the related logical operation and object rendering; For example, in a lot of killing blame, the mini radar map basically does not work, then we can use this button to close it, save more CPU to make the game smoother, so that players can experience the thrill of fighting more.

2 Mini Map zoom function. Here I need to talk to you about my mini radar map production and processing methods; Of course, perhaps you have a better solution than that, look forward. As for my project, it is the perfect way to create a personal feeling that is filtered out after a variety of attempts.

The first step, I first for each map to make a equal proportional reduction of n times, and unified size map picture. Take the first map of my demo as an example, the original size of the map is 4800*3600, then I will be reduced 8 times times the size of 600*450, and then through PS to save 30 of the quality of the picture capacity of only more than 30 K, At the same time it can also be as the next section I will explain to you the Mini radar map image source used, kill both birds. Similarly, the second map size is 2400*1800, so I narrowed it down 4 times times to the same size as 600*450, and so on. Of course, if the irregular size of the map can also be treated, just reduce a certain number of times, so that the final size is less than and close to 600*450 this size can, as for 600*450 this size how to come? See the next section for details.

The second step is to add a configuration for the mini radar map, taking the first map as an example:

<MiniMap Scaling="8" MinScaling="1" MaxScaling="30" />

The configuration describes the number of smaller mini radar maps, as well as the minimum and maximum variation scaling limits. That corresponds to the X in the above figure, and to the right-, + button function.

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.