Graphics and Animation in C# - c#

I created a Game in C# (Multi-player Tanks Game) using Windows Forms Tools (Panels, shapes, buttons, etc...) but the Animation and Graphics are just so poor, so is there any Type of simple Graphics or Animation to use in C# to make this game a little better, can I use flash in C#, anything?!!!

XNA is great, its a completely different technology to Windows Forms as its based on DirectX.
Another idea is to check out silverlight or WPF depending on how complex your game is. For simple 2D games with not too busy screens it might be a lot easier than XNA.
I found a great example of building a multiplayer game in WPF.

I would recommend having a look at Microsoft XNA.

I'm pretty sure if you want to improve the graphics of your game you're going to have to use design software or hire someone to do it for you. A simple look up on Google will direct you to model development software.
A good place to start is the microsoft XNA framework.
I also recommend using Blender: http://www.blender.org/
It's a completely free open source 3D model creation program.

There are many librarys and ways for game development in C#.
I prefer to use XNA, which is based on DirectX and developed by Microsoft itself.
But there are also many other wrapper like OpenGL wrapper SharpGL, a custom DirectX wrapper SlimDX or using the plain DirectX SDK.

Some time ago I was looking for libraries or frameworks to improve winforms experience with nice animations. My best options were XNA or OpenTK (OpenGL) and SDL.Net.

Related

C# ASCII based game

I'm trying to dip my toe into game programming, C# is the language I'm most comfortable with and what I want to use.
I've purchased a book and it's very good with the basic concepts but it's using GDI, bitmaps and sprites. I'm no artist and I'd like to concentrate on game play rather than eye candy, I'm more than happy with 'Dwarf Fortress' style of presentation.
DF doesn't seem to be a Console app (to my untrained eye). My question is can I access this 'graphic mode' from C# and if so how? Any tips links tutorials would be very helpful and appreciated.
Writing a 2D game in C# is actually very simple. Try with XNA. A simple tutorial that got me started with 2D was this...
http://create.msdn.com/en-US/education/tutorial/2dgame/getting_started
It basically covers a simple 2D side scroller but what you get from the tutorial will be useful in your DF like game. It requires you to create some graphics but like you said, those graphics need not be fancy. Drawing simple sprites will be easy enough.
Console games are a great way to enter the game making business or hobby, once you are very comfortable with c#, try to go to xna or unity. Xna is not being developed anymore and I don't find it very pleasant and prefer unity over it, but many people differ from me so please try it out for yourself. Unity is a 2D and 3D game engine wit a free and paid version. It can be complicated at first but very well made. You can develop in c# and many more languages with unity and it is a lot more flexible than xna.

Metro App with 2D Graphics in C#

I have done some looking and I can't figure out a good way to write a 2D tile/sprite based game in C# for Win8. According to the MSDN documentation:
You can use managed code languages like C# and Visual Basic to develop 2D (and lightweight 3D) games.
The problem is that I can't figure out how to do this. The reason I would like to use C# is because I already have a lot of code written for Windows Phone that I would like to reuse.
Can anyone point me to how I would write a fairly efficient 2D tile/sprite MetroUI game for Win8? The only thing I can find uses C++ and DirectX.
[EDIT]
To clarify I do not care too much what I use (WinRT, DirectX...) so long as I can submit to the app store, and write my code in C#.
If you are familiar with the DirectX API, you can use SharpDX available via http://sharpdx.org. It is basically exposing DirectX APIs into C#. From my understanding, if you are going to upload apps to the store, the SharpDX should be fine and pass compliance, but I would look into it further before going too deep.
Also, as of this time, not all of the features are available (like Direct2d not fully certified for Win8 Metro).
If your game uses simple graphics, you can use Drawing Library for Modern UI, it exposes a GDI+ like interface to be used in XAML/C#/VB.NET Windows 8 Modern UI applications, it works by drawing to a XAML Canvas.
If you're looking for something quick and easy check out the "Physics Helper XAML" project;
http://physicshelperxaml.codeplex.com/
It's based on the farseer engine, and comes with sample apps. There are a few games already released using it.
http://www.andybeaulieu.com/Home/tabid/67/EntryID/223/Default.aspx
Have a look at:
[XAML images sample] (http://code.msdn.microsoft.com/windowsapps/0f5d56ae-5e57-48e1-9cd9-993115b027b9/sourcecode?fileId=102748&pathId=677969581)
The page and samples give some code for NineGrid and WriteableBitmap Image manipulation.
You can now use Win2D (open source, released by Microsoft for metro/WinRT apps) which provides hardware-accelerated 2D graphics rendering.

How to make games with WPF or Silverlight?

How do I make games in WPF and in C#? Is there a document in PDF format that explains this?
You could read the articles posted on Silverlight Games 101, as a starting point.
That being said, it's more just learning how to write games. Using WPF/Silverlight is just one way to render your game - but writing the game is pretty much going to require all of the same skills as using other platforms.
Google this name. The title of the book is "3D Game Development with Microsoft Silverlight 3: Beginner's Guide".
There is a 2D (sprite based) port of the XNA framework to Silverlight called SilverSprite The same tutorials that work for XNA work for this library.
Using WPF to create games is not recommended. You should consider using cocos2d, unity or another similar framework.
If you really have to use WPF, you can see an example here => mini wpf game

Best solution for simple game graphics in C#/.net

I'm making a turn-based top-down game in C#. The graphics requirements are pretty simple: it's entirely 2D, requires drawing some images taken from graphics files (perhaps rotating them first), line drawing to make a hex grid and the ability to place text at any position on the screen.
I'm wondering what the best API is for doing these graphics. Is XNA overkill for this, is there something more appropriate? Thanks (I have zero experience of graphics or game development in .net so don't be afraid to dumb-down any answers).
I'd recommend XNA for this. If you don't want some of the overhead of XNA, I've found SlimDX to be a very nice little framework. They also provide some basic game classes to make this type of thing easy.
Doing your drawing directly in WPF is also fairly easy, but more difficult to extend later. XNA and SlimDX give you access to shaders, very fine grained control of alpha blending, as well as the potential to easily extend portions into 3D later if needed.
I've used the Farseer Physics engine before which was pretty cool and extremely easy to pickup (I am an enterprise developer, not a game developer). It works for Silverlight so you could actually make your game web based. I would suggest silverlight or WPF for 2D.
http://www.codeplex.com/FarseerPhysics
I would recommend WPF. Loading your graphics and moving them around should be fairly easy. Since WPF also is vector based, your line drawing is straight forward.
XNA would be the next step. Great support for sprite graphics and also gives you access to shaders.
If it is as simple as it sounds, and not even real-time, maybe you don't need any of this stuff. Drawing a hex grid and some images should not be hard even without a game engine. Maybe WPF would be good for this.
Given your requirement you could just use plain C# and the GDI (for 2d rastering). However learning XNA is easy enough, and it'll serve you well once you decide to make a realtime game (2d or 3d) down the road. Either way have fun, and if XNA seems to complicated when your starting out, just drop back to GDI. Making games should be as fun as playing them :)
XNA sounds like a good choise (it will better than using DirectX SDK !! and it is quite easy to learn)
You can do this by just using classes inside the System.Drawing namespace. And XNA is certainly overkill for this type of stuff. Also you would introduse many dependencies for your small game which might be an unwanted thing for your gamers.
Check out Unity 3D - it's based on C# and it can be used for 2D. It might be overkill (including price), but for game development it's in general HUGE help.

Game Loop and GDI over .NET CF

Hi i want to write a game with a main game form and lot of other normal forms. What is the best way to manage update-paint cycle in that case?
Should the game form paint loop only should be overriden? or should i do an application.do events() in the main method?
Please guide me regarding this. i am new to windows forms world
The body of the question doesn't mention Compact Framework, just Winforms. This is pretty much the accepted answer for Winforms from Tom Miller (Xna Game Studio and Managed DirectX guy from Microsoft):
Winforms Game Loop
#Rich B: The game loop is independent of how the rendering is done (DirectX, MDX, GDI+)
Your logic thread should be separate from the form, so you won't need DoEvents(). If you're using GDI+, then you should force an Update() on a loop. Windows Forms doesn't do double buffering very well, so depending on how sophisticated your graphics will be you might have some difficulties with flicker.
My suggestion is to look at using the DirectX managed library. It's a lot to learn, but gives you everything you need.
EDIT:
I have been reading recently about WPF, which seems like a much better platform for simple to moderately complex games, because it provides a much higher level API than the DirectX managed Library. It probably has performance and flexibility limitations for more complex games, however.
If you are making a game, you should be looking into DirectX, OpenGL, or XNA.

Categories

Resources