Today, my younger brother is out of the closed state, updating the Svn of lgame. The updated file is: Lgame-0.3.3-beta(201202292.16.7z
So the blog said a whisper, because the updated younger brother secretly added the C # beta version of the LGame-0.3.3 in SVN (support windows, Xbox, WP7 and other environments, if mono exists, you can also fine-tune the code to run MAC (monodevelop), IOs (monotouch), Android (monodroid), and so on, mono supports a lot of mobile phones), but it requires an extra $ (it was received by mono, not even ......)).
From today on, lgame has launched the C # edition for external users (in fact, it already exists, that is, it hasn't been released ......).
Originally, the younger brother expected to release the official version 0.3.3 in February. As a result, development was delayed and the progress was slower than expected. C # has been built, but the previous versions of the RTS module have not been written (Java and C # have not been written, from last year's pen to writing soon, today, I almost didn't add any more code, but I was not very lazy.) in the original Java version example, except for AVG and srpg, I have not migrated them to C, not to mention the document. |. As a result, the younger brother, in the spirit of "no bite, no more debt, no worries", has a slight change in the development plan. At this stage, he is still slowly updating the 0.3.3 beta version in SVN, after the C/C ++ and HTML5 versions such as the official version are completed, the four editions of the belt license will be sent one by one.
So today is definitely not officially released, younger brother just slowly come over, with a deep sneaky voice quietly greeting: "added C # support LGame-0.3.3-Beta has been uploaded ". This is a maximum of half of the hops -_-
Currently, only the core package DLL and source code are released to SVN, as well as the empty project template (Hello World) with 2500 commonly used Chinese character libraries. Other auxiliary packages must be tested, after two days, tune the configuration and add it to SVN. In addition, the example has not been uploaded yet. The younger brother is ready to wait for completion before sending SVN together (in fact, just copy the Java version of the API. Besides taking care of C #, the first letter of user sentiment is capitalized, true. (the first character must be capitalized. First, make sure that the variable and function name in C # are the same. Another benefit is writing script conversion in the future. It is more convenient to swap other syntaxes with C #, so you can process them in a unified manner ); besides, the younger brother has added a lot of C # Java-like functions ).
In fact, even if you don't need to use lgame and want to study C # game or engine development, or you need to port Java code to C #, you can refer to the source code uploaded by the younger brother, for 2D development only, even if beta is released, it is much better than reading books or learning from other projects. I hope that after the start of the younger brother's journey, the original C # game engine of the hacker will be able to get up more, and the foreign market of the hacker will not be able to find a solution, otherwise, foreigners really think that there are no living people in China (it is really boring to take some code that doesn't know what it means, especially some people prefer to copy redundant parts, is the code esoteric? Hello, this is C #. Some of the wordy syntaxes brought about by other languages can be avoided ......).
The younger brother is expected to run the C/C ++ version within 4-5 months (the first version only supports running Windows, Mac, IOS, and PSP. Other environments may not be guaranteed, it may not work. | but it will be extended one after another. It is the basis of SDL ~ (Simplified, only some of the code is needed) and the HTML5 version is released, that is, version 0.3.3 of lgame.
PS: after the four basic versions of Java, C #, C/C ++, and html5, otherwise, it is almost impossible to develop four versions of different syntaxes on their own. The main reason is that the runtime environments of these four are repeated, and debugging is time-consuming, which is hard for individuals to bear ~
Then, I will add additional syntax support for C/C ++ (pure interpreter mode, non-virtual machine, but I will allow the script to be compiled into something that is enough to confuse Apple, reasonable avoidance of Review), preliminary consideration to support Java and C # syntax (syntax features are only available to jdk1.4 and. net2.0 and later versions are not available for the time being. In addition, we also consider using Ruby and python to support the syntax. It is not finalized yet (if you have time, the younger brother also wants to have some new things and use multiple syntaxes in the experiment ). It may take at least seven or eight months to finish writing these documents. This version will be 0.3.4.
Then the younger brother is ready to turn back and add javafx support for Java and Silverlight support for C #. The two products are simple, strive for a one-and-a-half-month solution (although it may become "last care "). Now, the younger brother can start to write visual ide. In short, try to simplify the development process. After completing all the above, I will follow the Chinese trend and take the most sinister and popular step, guangzhao technology, shuijun, is pushing-_-(in China's largest and most open technology gun, the "Village" is released, and the younger brother also knows several people. In addition, we can also make some free games, such as millions of downloads in a few months )......
Of course, some function extensions and optimizations will be completed together in this process.
------------------
There are three differences between C # and Java:
I. Screen Size
As mentioned before, the default screen size of C # And java will be different.
The default screen size of the Java lgame is 480x320 (horizontal screen. This is the case because the size of the image is reduced, and the C # version is 800x480 (mandatory for the Microsoft vegetable market ). Assuming that the default settings are used, you need to set the maxscreen size when porting JAVA games to C # directly, in this way, the C # version of lgame can be automatically scaled to the Java version of the screen ratio.
For example, if we run the Java version AVG sample in C # without any setup, we will get this effect.
Because the original settings run according to 800 x320, but the actual screen size is 480 X, there will certainly be access.
In fact, as long as the setting of maxscreen (480,320) is added, it will become like this (the difference can be seen from the log data of lgame ).
At this time, the effect is exactly the same as that of the Java version (of course, if you need a x screen at the beginning, or want to make a difference in the screen size, you don't have to change anything ).
In addition, if some games with inherent limitations on the screen or with a size greater than X 7 need to be transplanted, you can also use this method for automatic scaling, which is common in all versions of lgame.
2. Handle support
C # by default, in addition to Windows and WP7, the C # edition can also run on the Xbox. However, Xbox generally uses controllers instead of mouse or touch screen games, therefore, you need to introduce additional controller control during game development.
Currently, the C # version of lgame provides the gamepadlistener interface (available only for the gamepadlistener and PSP versions), which includes event listening for all Xbox game controllers. We only need to implement this interface, in addition, you can use the addgamepadlistener function of screen to add listeners (multiple listeners can be added) to obtain the specific handle data and then operate the game.
3. Use resources other than content projects
XNa uses the pipeline technology by default (A obfuscator that everyone knows how to decrypt ......), Compile Resources in the content project into xNb files for users to load. However, C # does not provide many pipeline implementations by default, and it cannot meet all the resource loading requirements. (If Mono is used, this function is useless. Therefore, I personally think it is useless to implement pipeline on your own ). Therefore, in order to load and process some special types of files, we sometimes cannot use the xNb generated by the system by default (all resources that can be loaded through the load function of contentmanager are suffixed with this suffix, only the system shields the suffix by default), and the resource file must be retained in the original format.
At this time, we will set the format of the resource file in. To obtain resources in non-xNb format, the following two conditions must be met.
1. Files cannot be stored in the content project automatically generated by xNa. Otherwise, the files are either compiled into xNb format or the system reports an error in packaging. (This means that we usually need to add a new folder in the project where the game source code is located)
2. for resources in this folder, you must manually set the build action item under the attribute to content or resource (read resource is limited to lgame, and system must be introduced. windows. application Support), and copy to output items, cannot do not copy, otherwise Vs will not package them into the xap WP7 application package (lgame has a effort-Saving Approach, use lpkutils to confuse all resources, and then load a separate LPK package. Of course, adding one by one does not matter. After all, attributes can be set in batches ).
PS: Take a note, as shown in. after xNb is generated for files such as spritefont, we can. spritefont is deleted from the configuration file. After that, decompress the xap file and use the generated xNb file. (This article repeats this article. xap is actually a zip file ), in actual packaging, the system only recognizes the xNb file and does not need it at all. spritefont. Otherwise, you can create a Chinese font. A complete font can be compiled for less than one or two minutes (more than 20 thousand Chinese characters will generate more than 10 MB xNb files, which are generated by writing batch processing and selecting words, A few MB) is a waste of time.
----------------------------------
I was expected to write more things tomorrow, but the younger brother just found that this month was only 29 days (I always thought there were 30 days ). If you do not issue a ticket today, it is a complete jump. Therefore, you need to upload the C # core source code first. After two days of transplantation, the younger brother will secretly come and talk about more specific development issues (the younger brother secretly comes, secretly walks, doesn't want to shoot, but does not say anything, wait until the "Basic Version 4" is built ).
It is said that cross-platform is a trend. In fact, cross-platform alone is really weak. This year, the younger brother is preparing to develop cross-syntax, cross-host, cross-system, and cross-platform programming. It also supports mixed multi-syntax programming, comes with a visual game drag and drop generation tool (Narrator: This person is crazy, hitting 999)
The younger brother still has something to do over the past two days. He wants to go to this blog on Saturday or Sunday (before that, he must complete the C # example and adjust the auxiliary Package). Let's say hello, then let's get disconnected ......