dir.by  
Поиск >>

Компьютер, программы
→
Разработка игр | для телефонов на Unity, MonoGame | для браузера Google Chrome на JavaScript, HTML | рисуем графику
→
My game "Animal Go". Technologies: C#, MonoGame, Windows, Android, iOS
 My game is "Animal Go". How to play. Description | The game is written in C# using MonoGame (runs on platforms: Windows, Android, iOS) 
посмотрели 6968 раз
обновлено: 22 September 2023
Goal of the game: Do not let the enemy pass.
How to Play: You need to put the heroes on the playing field.
Download my C# code from github.com
Windows
Android
iOS
My philosophy for writing a game in C#
1) I write code for C# (game) and then after a while I look at the C# code in this game and see that something is not logical.

2) Or you can imagine that the 2nd programmer looks at C# the code of my game and does not understand everything, that is, something is not logically written.

The 1st and 2nd points mean that my c# program (game) is poorly written and the classes are very much tied to other classes.

As a result:
• To change the logic of the game, you have to be wise
• To add new functionality (a new hero in the game), you have to write a lot of code and the program becomes very complicated

I rewrote the game several times and if I see that something is not logical (point 1 and point 2), then I rewrite it again.

The program is written PERFECTLY, which means:
• Easily add new objects to the C# program (with a small and understandable C# code), that is, the program is easily expandable
• c# the game can be written by 2 people and c# the code becomes more, the program is understandable
• It is important that c# the game can be easily rewritten into another programming language, for example, Java
Game structure (files)
When writing a game, you get a lot of C# classes.
For each C# class I create my own .cs file
D:\MyGit\MyGame_AnimalGo_MonoGameCSharp
        Android
                Activity1.cs
        iOS
                Program.cs
        Windows
                Program.cs
        GameLogic

                Game1.cs

                MyGame
                        ImageType.cs
                        MyGame.cs
                        MyGraphic.cs
                        MySettings.cs
                        MyTexture2D.cs
                        MyTexture2DAnimation.cs
                        interfaces
                                IMyGraphic.cs
                                IMyTexture2D.cs
                                MyColor.cs
                                MyPoint.cs
                                MyPointF.cs
                                MyRectangle.cs
                                MySize.cs

                MyLevels
                        MyLevel.cs
                        MyLevelIntro.cs
                        interfaces
                                IMyLevel.cs

                MyUnits
                        AnimPictureDieByTime_Template.cs
                        BackgroundSquad_Template.cs
                        Fire_Morkovka.cs
                        Fire_Template.cs
                        Trajectory_Template.cs
                        Unit_DogGo.cs
                        Unit_EnemyBird1.cs
                        Unit_EnemyPauk.cs
                        Unit_EnemyZmeia.cs
                        Unit_KrolikStayAndFire.cs
                        Unit_Template_FireOnDistanceIfSeeEnemyUnit.cs
                        Unit_Template_StopAndHitIfNearOtherUnit.cs
                        UnitWillAppear_Template.cs

                        interfaces
                                IAnimPictureDieByTime.cs
                                IAnimPictureDieByTime.cs
                                IFire.cs
                                ITrajectory.cs
                                IUnit.cs
                                IUnitWillAppear.cs
The game logic is written as a library and the same code is used for different platforms
All the logic and drawing of the game is written in the library GameLogic.
 
Project Android uses the GameLogic library.
 
Project iOS uses the GameLogic library.
 
Project Windows uses the GameLogic library.
 
← Previous topic
Habr story [kavichka]Network game Tanks in HTML, JavaScript[kavichka] (nodejs, socket.io for the web, PixiJs library for graphics)
 
Next topic →
How do I write a game "Animal Go" on a computer Windows. I compile, get the exe file and run it | C#, MonoGame
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

Новость "Черная пятница" Dreame в Беларуси – две недели скидок до 3400 рублей
 
My game development in HTML, Javascript, Typescript
• Writing a game using HTML, JavaScript, TypeScript in Visual Studio Code. I"ve created some ts files. That"s why I use Webpack (collects all files into one js)
• Animation of the little man on the spot. For <div>animation, we use CSS styles: "animation", "background-image", "background-position", "keyframes"
• Animation of a man in motion (sprite). For <div><img>animation we use CSS styles: "animation", "background-image", "background-position", "keyframes"
• My Game "Wizard World" | HTML, JavaScript
• Habr story [kavichka]Network game in HTML, CSS and JavaScript[kavichka] (nodejs, socket.io for the web, HTML canvas for graphics, game maps in js are set)
• Habr story [kavichka]Network game Tanks in HTML, JavaScript[kavichka] (nodejs, socket.io for the web, PixiJs library for graphics)
My game "Animal Go". Technologies: C#, MonoGame, Windows, Android, iOS
• My game is "Animal Go". How to play. Description | The game is written in C# using MonoGame (runs on platforms: Windows, Android, iOS)
• How do I write a game "Animal Go" on a computer Windows. I compile, get the exe file and run it | C#, MonoGame
• How to compile and run the game "Animal Go" on your phone or in emulator mode Android on your computer (Windows) | C#, MonoGame
• How to compile and run the game "Animal Go" for the system iOS | C#, MonoGame
Creating graphics, animation for a 2D game
• Which picture to draw for a 2D game: a raster png image by dots or a vector svg image by lines?
• 2D animation for the game

  Ваши вопросы присылайте по почте: info@dir.by