Advertisement

Hit a roadblock

Started by September 09, 2013 04:18 PM
2 comments, last by Goran Milovanovic 11 years, 5 months ago

I've gone through books and books of xna and c# these past few months and I feel like I've hit a bump. I understand mostly all of the code thats been given throughout these books, but whenever I try to create a tetris or snake clone I get stuck.

Is there something I'm doing wrong with the way I'm learning? My process is to write the code, read the explanation, and reread and recode anything I don't understand. Before I move forward any further I want to make sure that I can create a simple game like tetris from scratch

I've tried learning c++ with opengl and directx, but my heart belongs to xna for some reason. I thought that learning new libraries would help but thats not the case

If you see a post from me, you can safely assume its C# and XNA :)

You have learned all the syntax, you just need to learn how to use it now. Try designing Tetris as pseudo code and class diagrams. I am guessing that you are getting stuck at splitting up each part of your game into different classes. You should probably try and come up with a few very simple programs that have an OOP architecture. My first experiment with OOP was a simple program called "plants". There was a "Plant" class, and a Flower and a Tree class, both which inherit the Plant class. The flower and the tree are instantiated in a main "Garden" class, in which the amount of sunlight and water for both plants is controlled. I added a simple user interface that controls those parameters of the garden. I suggest doing something similar.

Even if it isn't OOP your having trouble with, you can do similar mini projects for different things you may be unclear about. Make small applications that do simple things like draw and move shapes around the screen, do simple collision detection etc.

Stay gold, Pony Boy.
Advertisement

I think the advice given by Mr. minibutmany over me here is great, and I have to admit I should be doing the same thing myself more often.

I'm working on something insanely complicated, (but then again aren't we all!) and there are many times where I really should be doing a smaller version of the problem area, if not only to help myself understand it better, but also to have something that you know works :)

Well, libraries will help with the implementation details, but you still have to work out the relevant algorithms.

The difficulty depends on what you already know, and the tools you're using. I wrote an OpenGL Tetris game in pure C, and while not overly difficult, it could have been much easier with a higher-level language, and better tools.

If you want to look at the source, it's on my github: https://github.com/GoranM/wtetris

A video of how it plays:

I'm working on something insanely complicated, (but then again aren't we all!)

That's why so few of us actually finish anything. smile.png

+---------------------------------------------------------------------+

| Game Dev video tutorials -> http://www.youtube.com/goranmilovano | +---------------------------------------------------------------------+

This topic is closed to new replies.

Advertisement