|
OK thank you again,
I have pleanty to get going with.
Thank you,
Steve
|
|
|
|
|
You may wish to evaluate MS's XNA[^] platform for gaming. Uses C# (and now VB, as well).
And, check out ASPDotNetDev's comments here:[^], as well as[^].
I have no experience with XNA, have no idea what it's current and future status is, but other folks here on CP do !
best, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
|
|
|
|
|
Thank you,
I will have a look at XNA aswell,
Steve
|
|
|
|
|
You need more details in your idea.
Angry Birds is not in any way comparable to World of Warcraft. And neither is comparable to Portal.
Not conceptually and not in implementation.
And your question is, vaguely, about display options only.
stephen.darling wrote: would prefer to do this as close to 100% C# as possible
So in terms of this and your mention of "online game".
Then your strategy would be.
1. Design the game.
2. Create a C# game that runs on your computer. GUI and internals are all in C#. (Nothing online about it and ONLY one person.)
3. Create an installer for the game (2).
4. For the online part create your own down load server and allow the installer (3) to be downloaded from it.
Now if you want to create a game where several people play against or with each other then the strategy is different.
A. Design the game.
B. Create the game server. This handles communication between players.
C. Create the client app. This must include a way to find or designate the game server. There are different ways to implement this.
D. Create a down load server (not the same as 2) which allows a user to get the client app.
There are details that can modify the above strategies in different ways. For example you don't need to actually create a down load server. There are hosting companies and sites that will provide that for you.
Another variation is in C above where it could be entirely browser based. That eliminates step D but has its own limitations. (Although making it browser based is probably a good learning exercise and for a single person sufficient.)
1. Create
|
|
|
|
|
Thank you for the advice, however, the game will be simple and aimed at one player. It must run in the browser as I must retain full controll of the source code.
The game itself will be very basic, with basic graphics and minimal animation.
I am currently persuing the idea of hosting a c# app in silverlight.
Thank you,
Steve
|
|
|
|
|
Does anyone know of a class library, have example code or an algorithm to determine the optimal number of shipping containers required to transport x stock items? Stock items or varying sizes can be packed into the same shipping container.
We'll have the dimensions of the various stock items and the shipping containers, and would like to feed this and the item quantities being shipped into a routine.
Regards,
Andrew
Andy
|
|
|
|
|
yes, knapsacks are described here[^].
|
|
|
|
|
Unfortunately that article and the related packing problem article [^] are written in a language only mathematicians understand.
Andy
|
|
|
|
|
Capital sigma is summation. And, now that you know the name of the problem, you can google for it.
|
|
|
|
|
|
I have to present a value (as string) into many formats
i.e :
Possibility to converts the data in differents units of measure
Exemple if I have Centimeter
L = 2019.80
and User chooses meter so the new L become
L = 20.19
Also depends on Precision :
if Precision = 2 I have L= 2019.80
and if Precision = 3 I have 2019.800 ...
So can you help me ?
|
|
|
|
|
You need to look into the String.Format methods[^]. The link points to the MSDN page for this.
As for converting lengths i.e from centimetre to metre etc, you are going to have to have some sort of conversion class that does the actual conversion, and then calls String.Format on the result.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I need to check whether password has at least 6 characters with at least 1 letter and one special character. I am checking the condition !Regex.IsMatch(strPassword,"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,24})$"). But it doesnot allow special character.
I need to change the expression to check if there is at least one special character.
Please help me out.
|
|
|
|
|
In .NET regex language there is a character class "\W" that represents "non-word characters" (i.e. characters other than letters, digits, or underscores). You could also replace your [0-9] with "\d" (note the lower case).
P.S. I think this question may be better suited for the regular expressions forum.
|
|
|
|
|
I am assuming you consider # and @ to be the allowable special characters:
^(?=.*[#@].*)(?=.*[a-zA-Z].*)[a-zA-Z0-9#@]{6,24}$
Anything that matches that will be a valid password (between 6 and 24 characters, contains only letters/numbers/special characters, contains at least one letter, and contains at least one special character).
Martin Fowler wrote: Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
|
How do you make repeatable backgrounds for things in XAML?
Back when I was working with HTML, I remember having bitmaps as backgrounds for either a page or for an area.
Now I find I want this same sort of thing in my XAML page for Silverlight. How do I do that? How do I make it repeatable so that the image pattern exists across, for example, a header area no matter how wide the browser window is?
|
|
|
|
|
I think this question belongs in the Silverlight / WPF[^] forum.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
|
Hi,
I was just woundering if anyone knows how I would do this...
I have an image of a roulette wheel, and I would like to animate it as it was spinning, faster to slower and then stop.
How would I achive this using c# and winforms, as I am not ready to delve into WPF just yet?
Thank you,
Kind Regards,
Steve
|
|
|
|
|
Yes, WPF makes things like that considerably easier.
No concern though. First thing to do is rotate the image, which is presumably represented as a bitmap in code. Get to the graphics object, and that's got two methods TranslateTransform and RotateTransform (as I recall) which should do the rotation. If everything's perfectly circular you may not need the translate transform. Then, create a method which rotates the image as needed. I'd probably create a custom control for just this purpose.
You'll have to use the System.Windows.Forms timer to update the angle in such a way to make it look like real movement.
Regards,
Rob Philpott.
|
|
|
|
|
Would that be better than using BitBlt and 36 separate bitmaps in memory?
Or maybe creating an AVI and using DirectX?
|
|
|
|
|
DirectX would be overkill, as it would add a lot of complexity before getting anywhere.
Whether 36 separate bitmaps are better mostly depends on how fast GDI+ (which is used by WinForms) can transform the image. If it is real-time enough, then it is fine to do the transform every time (don't forget to keep the original image in memory and do the transform on a copy every time).
If the performance is too low, then you'll need to go for the multiple images (but this will use a lot more memory).
|
|
|
|
|
there are 37 numbers on a roulette wheel (without number zero the casino could be in trouble pretty soon); and you probably also want some intermediate positions, especially when the wheel slows down, so 37*5 images seems more like it.
|
|
|
|
|