If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

C# Game Code Samples I would like to see ....

Hi,
I'm trying to learn game programming with C# and was just looking for some very rudimentary examples. I would just like to see some very basic code samples which each do one simple thing. I drew up a list of what I would consider to be a good game programming 101. When I was learning BASIC some 20 years ago, I was able to learn to do most of the stuff on this list within a few days. I am having a much more difficult time doing the same thing in C#.
I'm sure most of this stuff is unbelievably simple for somebody out there. Please help by submitting some of the samples on this list.

Note: Each of these should be a separate code example. I'm not talking about one big application that does everything on this list.

Make a dot

Make dot move every time you hit the enter key using a simple loop

1. Draw new dot each time refreshing the screen

2. Keep adding more dots to existing canvas

Make a game loop which exits when you hit the Esc key

Make dot move using arrow keys

Make it so when dot exits on right side of screen it enters again on the left

Make it so dot cannot go beyond edge of screen

Make a square room for dot

Make dot move around at 45 degree angles and bounce off walls like in Pong

Make a rectangle paddle and make it move left and right using mouse

Add collision to paddle

OK now let's think Space Invaders:
Change the paddle to a 2D sprite of a spaceship

Change the dot to 2D animated sprite monster

Make the ship fire dots every time you click the mouse or hit the spacebar

Make it so when dot hit's monster, it adds a point to score displayed on screen

Make monster display an explosion graphic and disappear when hit

Now think Pac Man:
Player has 3 lives. Every time a monster touches player, the game halts and you have to start over. After 3 fails, display the end screen with final score and give the option to play again.

Now, make level 1 with 1 monster, level 2 has 2 monsters, level 3 etc...
each time you complete a level you get a congratulations screen.

Add sounds. Exploding monster, firing gun, looping soundtrack.

Create a high scores list. Allow user to enter their name if they make the top 10.

Now let's think 3D:

Make a cube

1. Rotate cube in x or y using mouse

2. Rotate camera around cube using mouse

Make a 3D room with the camera positioned above the room looking down.
Add textures to walls.
Add tiled texture to floor.

Add a teapot and apply a generic color

Now think Tanks:
Make the teapot rotate using the left and right arrow keys and move forward using the up arrow key.
Make the teapot fire a ball when you hit a mouse button or hit the space bar
Create explosion effect when ball hits wall or object.
Draw graphic on wall where ball hits.
Add parablic curve to ball trajectory to simulate gravity.
Add colored cube Ammo Pickup and give the teapot an Ammo Limit.
Make pickups appear periodically in random locations.
Add assorted color obstacles using various DirectX primitives.

Basic AI
Make a colored cone with the point facing forward to indicate the front.
Make the cone a zombie: randomly wandering about, bumping into walls.
Make a different color zombie. This one still wanders aimlessly, but avoids walls and obstacles.
Make another color cone which follows you wherever you go.
Make another color cone which will follow you only if you are within it's field of vision.
Make another which will only attack if you are within a certain range.
Make an enemy that shoots back at you.

Make enemies which will spawn duplicates of themselves if you don't shoot them within a certain amount of time.

Replace teapot with mesh model
Make model play an animation when moving forward / shooting

Make the camera follow the model
Make objects which get between camera and model transparent
Make option to switch between First Person and camera views

You have to answer your own questions around here

Well, I have managed to get quite a way down my list so far. All on my own and unassisted from anyone. Since this post has been up for months and not a single soul has bothered to offer any help whatsoever, I see no reason to continue wasting my time posting any further on this forum.
Goodbye and thanks a friggin lot!

Re: You have to answer your own questions around here

That is good though, the fact that you have managed to solve the problems on your own will have taught you far more than what any help from any member of the forum could offer.

No, it's not good. Visitors like me would have loved to utilize an anywhere near completed list for reference when trying to solve these exercises. If you don't get any response from other users, you're not benefitting from the fact that you are posting on a forum and hence are looking forward to receive feedback.

He would have solved some of these exercises regardless of response or not. All that would have changed is the completion of the list and the speed of progress. There's no way he could have learned less from getting one-to-one feedback from other people. That's like saying you don't need teachers because figuring literally everything out on your own is better than receiving feedback and explanations on how to do certain things. Even collaborating on certain tasks is commonly deemed more efficient than completely autodidact learning.

In any case, if he would have benefitted from it or not, you post to a forum in the hope of getting any form of response. If anyone would have come along and thought that it's better to work in complete isolation on this list instead of either getting help or collaborating, the least one could have done is say so.

I'll be looking forward to utilizing DillingerLee's many tutorials in JavaScript to some day create my own independent collection of tutorials. My thanks to DillingerLee, and thanks to all others who helped him (which sadly does not include anyone on this forum).