I'm learning for windows phone 8, and i wanted to write an app where i can move an image using the accelerometer, not a level detector, i want it to move just like in labyrinth games. How would i make this happen? Does anyone have any good samples/turials/explainations or similar? I have been searching the web for two days now, trying to be integrating it. It will be used for a very simple learning-game for myself since i learn alot from samples. I have started my project as a normal app, since this is what i absolutely like to develop with, the UI design, etc, i have already created a basic UI, and also things the ball can collide into, things like arcs and stuff(controls). I am writing it in C#, i also got a little knowledge from java game development (not very much).
Thanks alot!
There aren't any samples (AFAIK) that do exactly what you describe.
If you really want an accelerometer/labyrinth game, there's a C++ sample at http://code.msdn.microsoft.com/wpapps/Marble-Maze-sample-for-c9f3706b
Alternatively, there a lot of other samples to learn from.
These should keep you busy for a while: http://code.msdn.microsoft.com/wpapps/
Related
since this is my very first time trying to make yet simple but useable sidescroller I'd like to ask some questions and hopefully gather ideas to make a good engine that can change the position of an Image in the form depending on X position of the drawn game character. I'd basically like to recreate just few seconds of a Mario game.
The starting Idea (correct me if it's wrong / poorly performance / whatever) would be to create a picture long in width and whit fixed height and upon the press of, for example, A or D keys, the drawn character moves till a certain X point, after that, character gets locked in place and if the key is still pressed, the background image starts moving.
But the problem there would be the fix for collisions, would be possible to check for the X position of the drawn background picture and set "collisions" accordingly for the character?
Other questions : why picturebox should be avoided at all costs and use the form itself instead ? Placing the greater part of the classes methods inside a timer_tick event is the wrong approach ? I read somewhere that the best way to do games of this kind would be relying on infinite loops in the forms main method, but I simply cannot even think how this could possibly works, taking in count all the times we may need to get out of the loop and do different code in different places.
Any other different ideas/approach and direct links to further explanations would be greatly liked
Edit : yes i'd like to improve with windows forms before moving to xna/unity
Assumption: You want to make a little game and its your first time working with moving graphics and you're working with WindowsForms. Suggestion: try using a more advanced framework such as MonoGame or XNA and working your way through introductory documentation and tutorials. Also WPF has a more advanced graphics platform for doing things like drawing and 3D, you may want to give that a shot.
To expand on my comment a bit.
Windows Forms and GDI (the tech behind drawing) aren't meant for this kind of use. When GDI was created its purpose was essentially drawing lines and fonts on the screen. XNA is a really good framework for learning the basics up to professional design. Unfortunately the XNA framework is no longer supported by Microsoft and as such MonoGame is the recommended development route for managed .NET 3D and 2D game development.
The WPF provides basic access to Direct3D and Direct2D, and has 2D and 3D shapes and animations built into the framework and is what WPF is based on.
But you also have the choice, if need be, to create an XNA component and embed it in a Windows Form as demonstrated in these two tutorials.
XNA in Windows Forms I
XNA in Windows Forms II
Also using a Windows Forms Timer isn't recommended because they are unreliable. The .Net Framework provides a 'Server Timer' and a 'Threading timer' that can be used as well.
If you are really keen on using GDI for a game may I recommend reading about the basics of game programming (I think there are a few XNA docs on the subject) that should guide you on things like the basic run time loop, getting input, and simple physics.
I know this type of question has been asked a lot, but I really can't find something that nails what I'm looking for, so hopefully this is not considered an "asked without research"-question.
The backstory: I'm developing an app that initially was supposed to work on OSX/iOS, but having a Windows version is already a must. I'm trying to find out the easiest way for me to have to translate as little as possible between each version, and preferrably without having to learn too much new (I have a little time constraint).
I'm using C#, currently developing in Mono
I'm used to the Cocoa API on iPhone using MonoTouch
So, my options (as I see them now):
Go native on mac, meaning having to make a separate graphics routines for the other OSes - makes the mac version easy-peasy, and I could postpone any learning curve for the other ports, however I guess it requires a lot more meddling when porting
Use some kind of XML markup or HTML/JavaScript as a presentation layer, with hooks on links triggering backend events (I don't know how well that would work on different platforms) - would require me to learn a bit of JQuery, but it seems pretty straightforward
Make it an XNA project and use MonoXNA (or similar) to port - would require me to learn enough XNA to do it, don't know if it's a pain
Use some other multiplatform 2D kit I don't know of
Basically, I need animated 2D sprites, mouse and touch input, and it would really be nice to have movement keyframes and maybe rotation.
There's also sound, of course, but playing a sound file seems so simple on all platforms that writing platform-specific shouldn't be much hassle.
Have a look at MonoGame. It should suit your needs pretty well I think.
Hey, I know someone who is looking into developing simple video games on his pc, and then eventually, hopefully port or develop some on the XBOX 360 indie center, using XNA studio.
So, I have heard about C#? How easy it for a beginner?
C++ is pretty good isn't it? But I've heard it's QUITE deep, broad, and sounds pretty easy to get lot in.
Also, I am assuming he would need an application for GUI and graphical development for the game?
Obviously we need a menu, and some graphics (unless we're doing a text-based game to begin with).
What program is good for that too?
Sorry for the kind of hap-hazardous question, but I'm just trying to feel everything out.
If you want to develop for the XBOX 360 Indie Center, you really have to be using XNA. This is the main, supported platform for Xbox + PC development.
That will probably force you into C#, as all of the samples, and nearly all of the documentation, is done in C#. You'll also want to use XNA for the graphics, as well as the content pipeline.
The XNA Creators Club has quite a few articles to get you started.
The best way to start making games is to start making games.
In other words, just get going. XNA and C# are a good way to just get in and get used to doing things, and it's the best way to start developing on the Xbox. If you're a student, you can get some free software from Microsoft through Dreamspark, including a free limited XNA Creators' Club membership (it at least allows you to deploy to your own machine and test).
Eventually, you'll probably want to learn C++ if you are getting into professional development. It's the lingua franca of game development, and there's an expectation that you are at least intermediate in it (most companies don't expect you to be a language lawyer).
To put it simply:
For a beginner looking toward PC and XBOX, then the answer is XNA studio, using the C# language.
Microsoft provides a free version of Visual Studio developer environment:
http://www.microsoft.com/express/Downloads/#2010-Visual-CS
C# is a very nice modern language, and a very good first-time language, as long as you're fine with being tied to Microsoft Windows and XBox (more or less).
Programming is not easy, but it can be very rewarding to learn.
There are some nice C# and XNA tutorials out there.
C++ is hard.
Starting vg dev, which language?
C++. Reasons: large collection of libraries, backward compatibility with C, widely used.
Achieving good skill level in C++ will take from 2 to 7 years.
Also, I am assuming he would need an application for GUI and graphical development for the game?
There are multiple gui libraries, one of them is Qt 4, supported by nokia. There are alternatives.
Obviously we need a menu, and some graphics (unless we're doing a text-based game to begin with).
Graphics: gimp, blender 3d. OR photoshop, 3dsmax/maya/zbrush.
Menu - you'll probably have to write menu designer for your game yourself.
Now, let's get reasonable. Game consists of:
1. Engine (programming skill)
2. Music (composition skill)
3. Art (artistic skill)
4. Sound (sound recording/processing)
5. Script/story/idea (creativity)
6. Levels, ingame mechanics (that's game design)
Achieving mastery in each area most likely will take years. And developing a game takes time. You should expect that writing your game will take at least months, and aquiring skills for that will take at least year (if you're genius, that is). If you have previous programming experience, you can learn everything you need (though hiring someone to do it for you will be much easier) and write your game, but that won't be easy. Making a mod for existing game will be also easier than writing everything from scratch. Or you could use already available engine.
I think it is up to you which language will you choose, because you can develop games in (almost?) every programing/scripting language there exists.
As I know many games are developed under C++ and there are many ready to use libraries that can help you with that. I have some experience in programing games in Java and it's also good. There are also ready to use libraries, like Sprites to easy animate characters/items.
I am also sure that in C# it would be quite easy and there are also some libraries.
I heard that Python is also good language for games developing. I have no experience with that, but Python is quite easy language to learn/develop.
So if you have any experience in any language you try it :) I mean for PC games developing.
C# is a good starting place for XNA and Xbox if you're not already comfortable with C++. The XNA tools for Visual Studio are quite good and are maturing nicely. Later, if you need more flexibility and performance, you can move to C++ and DirectX (or some other graphics library). The most important stuff you learn about games from C#/XNA, such as game loops, 3D math, and shader programming, will travel with you from C# to C++, C, or whatever other language you choose.
As Feanor said, the best step is just to start. You can always change the details of your path later.
I'm a developer for just about 6 months now, and since I enjoy programming I've started little programs such as encripters, calculators, tools, stuff to play with DropBox (hehe), stuff that play with bitmaps, drawing graphics, and even a program to update the MSN display image according to the artwork of the music you're listening yo on iTunes.
One of my other hobbies is 3d modelling (completely amateur) and I'd like to mix these hobbies together! So I've read a little about it and figured I'd have to have good notions on geometry, math, point spacial position (which I do, from my 3d modelling experience), but I don't know how to use API's for it, so I've 'simulated' simple 3d with a simple program I've made (a spinning cube).
Here are some questions:
1) What would be a nice 3d development tool for a .NET programmer like me?
2) Is there a way of using 3d models made in 3DS Max ? (I intend on modelling characters)
3) What knowledge should I have in order to render it, and move it around ?
4) Which API should I use ?
NOTE: Not a dupe, I'm asking for directions specific for .NET development possibly using 3ds MAX, and there were no questions about it so far
EDIT:
I've got three answers that seem quite nice, so let me specify a little and maybe you can tell me what's the more appropriate tool.
What I'd like to build soon would be like:
portable (click'n'run, no need to install, and (hopefully) no need to send DLL's along)
"3D embedding" in winforms application, like a picturebox you could render in.
Real winforms application-like (having all System api's like IO, Drawing and etc)
The development enviroment would be nice if it:
Had the possibility to import existant 3D models (not a must, but a plus)
Had the ability to create 3d models programatically (a must)
Possibly has a tool for materials and textures (that would be a huge plus)
Is Well known (high availability of tutorials, questions in S.O., forums..)
And it would be really nice if I could use C# all the way :)
I'm going to provide another vote for XNA. The comment that it's too "game centric" is a non-starter - it provides a rendering loop with feedback on how fast everything is running so you can adjust your rendering to try to maintain a specific framerate (if you want). This isn't particularly game-centric as it's something that most 3D applications should worry about. The only thing that's really unusually game-centric about it is that it provides easy access to game controllers. Feel free to ignore that bit if you don't want to use it.
The only downside for you using XNA is your requirement that it be click'n'run, XNA has a redistributable that you have to worry about. Note that Win7 has this installed by default, but Vista and earlier don't.
EDIT:
XNA is made for applications that are strictly 3D. As such it doesn't natively support using typical windowing controls inside of an XNA project. But, there are ways around this...
A few useful links. Embedding XNA in a winform : http://forums.xna.com/forums/p/6471/34180.aspx#34180
WPF controls directly inside an XNA project : http://www.c-sharpcorner.com/UploadFile/iersoy/256/Default.aspx
Personally, I found XNA a little too "Game Centric" for my tastes. I was more interested in design/architecture type uses.
You may find SlimDX more to your liking.
Even though there are great suggestions in this post already(such as SlimDX and XNA), I'd just like to mention OpenTK.
OpenTK is closer to OpenGL than Direct3D, but it might be the best solution for cross-platform 3D .NET applications.
Since you are using C#.Net, the XNA library will be excellent for you. It is free off the Microsoft website and integrates into the VS IDE. A lot of available tutorials around to help get started.
Also, if I remember correctly. to use a 3d model in XNA, simply export the completed model as (.X). It can then be loaded into your work.
I vote you try Blender. www.blender.org
It's free, open source, and has a great community both on forums and IRC. Progress on the app is pushed forward by major community projects every year, some of which are movies and games and have won some awards. It is gaining industry acceptance as a way to model extremely fast.
Downsides: It's not considered as "pro" as Maya or ZBrush, and it has a very different brain about interface. Learning curve can be interesting, depending on how you learn and how much help you receive.
Upsides: It's free, great community, updated regularly, many tutorials and community projects to work on.
Community:
Blender channel on IRC
Blenderartists forums
Previous community Projects:
Elephant's Dream
Big Buck Bunny
My vote goes for Povray. It is a 3d renderer with a c-like syntax language. It doesn't satisfy your .net needs, but if cool non the less for 3d rendering. If you any kind of interactivity XNA is probably your best best. But I'm interested in your finds.
Re: "Has the ability to create 3d models programatically (a must)"
A few pointers:
Polygon Triangulation
(Dr. ?) Jonathan Richard Shewchuk's Triangle library
Dr. Hang Si's TetGen library
Constructive Solid Geometry
GNU Triangulated Surface Library
There are no .NET libraries I am aware of that allow you use the above mentioned libraries/techniques. You will have to use PInvoke or C++/CLI in order to make calls to these libraries from the managed world.
I want to write a little application for myself to learn C# and WPF.
The typical hello world in 2009 (twitter client) seems boring. I would like to hear your stands should I do a twitter client? Any other starters I could play around with and get used to c#? (I'm a longtime PHP programmer)
A Twitter client ends up being a good way to get started with WPF, for a few reasons:
It's got lists of data with images, which gives you practice with formatting and styling lists
There are a lot of options for styling what you're working on - partly due to the avatars, limited text blocks, etc.
A Twitter app is the kind of application where you expect to see good UI
There are some good libraries availble (I highly reccommed tweet#) so you don't need to bother with any of the plumbing
It's something you can show off and be proud of - people will understand what it does
There are plenty of complex things you can add on later if you want - skinning, drag and drop, autocomplete, spell checking, etc.
There are some open source WPF clients out there, so you can find some sample code if you get stuck
And the number 1 reason why it's good idea... you can start contributing your code to the Witty project. We'd love more help!
I recommend to write a native GUI (WPF) client for your most recent PHP project.
You can try writing a modelling tool (business processes flow/UML (classes)/execution flow i.e. scripts execution flow/etc...).
WPF Virtual Labs are a good place to start.
Only do a twitter client if that's what you're interested in. I don't see why twitter should be the new "hello world.", except maybe for making such a thing, like a twitter or facebook bot.
If you want to focus on C# and OOP, try something with many objects interacting, like a simple fighting game, poker, black-jack, etc.
If you want to learn wpf, try some fancy interface stuff, like a calculator, a video player, a photo gallery.
You're only limited to your imagination. Try to pick something fun, or something you'd like your computer to do, and code away. :D