Sign in to follow this  

programming tasks

Recommended Posts

Hello Everyone!

I'm a new member here on the forums. Although I've been visiting the past few months (when the thought of writing a game crosses my mind), I have never decided to sign up for an account just because I've been too busy to make an attempt. However, I've come in to some free time and there are ideas frequenting my brain about it quite often.

I graduated high school in 2005, took c++ classes and out of everything in high school its probably the only stuff I can remember (LOL). Not to mention I've purchased a c++ book and I've been learning a lot from it. Seems to go through the motions, and takes a practical approach - it keeps me excited about learning it.

The one issue I find, however, is the lack of ideas of what to program to test my knowledge. I've googled online, read forums about practice ideas but either they're too weak or they're way too complicated for where I'm at. That's kind of why I'm here. I was hoping that someone may be able to give me an idea / task to program something.

So far I'll say I have a good idea of basic programming (basic operators, loops, variables), functions, pointers & references (allocating memory, recalling/changing), and also classes (including deriving, inheritance, private/public/protected class / members and prototyping), using header files and multiple source files, etc.

Could anyone give me an idea that would test my knowledge of these aspects of programming. I don't mind if its fairly vast and even takes a few days. I want to practice it and work my problems out so I understand exactly what I'm doing.

Share this post

Link to post
Share on other sites
Focus more on gaining experience than "testing your knowledge". Testing for what purpose? A tendency with that is to delay getting any practical experience until you pass certain tests that later prove to be irrelevant.

Try to actually achieve some practical aims that step you towards making a tiny game.
1) Get a window on the screen.
2) Make window behave nicely (can you close it, minimize it, make it fullscreen, resize, whatever you need).
3) Create a colored square on screen.
4) Now enable Mr. Square to be moved by the arrow keys.

Actually making something is more fun than contrived tests. It's also good to spend time learning (reading books, etc.), but I think testing is silly.

Also, there are other programming languages that are better for beginning programming. Even though you have some familiarity with C++, it would still be more pleasant to start with a different language (and the studying you've done with C++ will help you learn another language more quickly -- no learning is wasted). I know how it is: C++ feels like it's not that complicated, and it seems like you understand everything perfectly well. But it's impossible to see how complex C++ really is before you start making real things with it. The difficulty of C++ is completely unnecessary -- there are languages that can do everything you'd want with much less complexity.

Share this post

Link to post
Share on other sites
You may find that 'too weak' or 'too complicated' are inaccurate once you actually start doing them, but here's what I've always done, and it has served me well.

1) Think of a game you want to program. As you're starting out, tend towards a simpler game, but it really doesn't matter much.
2) Start creating it.
3) As you uncover problems, use every tool as your disposal (internet, books, this forum, etc) to solve them.
4) Repeat step 3 ad infinitum.

I'm a learn by doing type. Most of the games I starting making way back when never even came close to completion - but I learned a lot in the process. Projects I start now are directly informed by those early experiences, and I even finish some!

Share this post

Link to post
Share on other sites
I really appreciate your advice and input. I have to say though I'm not exactly sure where to start when it comes to making a game. I would honestly love to start doing what both of you listed, I am just not sure how to go from programming the console/DOS applications to something with windows where there is something actually designed on a screen that I could control.

I'm pretty sure thats the step that I'm really missing. I have experience programming around engines before (not sure if you're familiar with RunUO, or NWN Aurora Toolset). I could create objects and make them do anything but when it came to understanding how exactly the platform was made I was :blink: to say the least. I don't know where to start unless I'm using a game engine (which I'm tired of).

If I could just figure out exactly how to create a platform and how to make an object realize there is a platform and then have the ability to move on it I'm pretty sure I would be golden.

Share this post

Link to post
Share on other sites
When working by yourself, from scratch, get used to thinking from bottom to top. Alright, so you want to build a platformer. We want a player to be able to steer a character across, up, and down various platforms in the game world.

Now we break the problem down into the constituent parts. (I'm doing this on the fly, so don't expect any genius to follow here!)

-How do we define the platform? At the simplest it could be stored as a simple set of four (x, y) pairs, with the understanding that all platforms are rectangular. So you build a little class that stores those pairs and can answer questions about itself, ie Is this Point inside this platform? Or is this point on the edge of this platform?
-How do we join these platforms together into a game level/world? Typically I would do that with another class whose only job is to coordinate platform and player interactions. In other words, the world keeps track of all coordinates and is constantly checking boundaries. If the player is at point A, is he on solid ground? If not, what happens? Does he fall? If so, how?
-How does the player move?

You'll be starting by creating very basic, simple functions that provide fundamental information. Take for instance the need to know: "Is the Player on a solid surface?"
Ask the world: Is Player on Surface?
World takes player's location and asks each of its 'platforms': Is this location 'On' your top surface? (platform has the function, on_Surface(Location) or similar)
--If any platform answers 'True' to that, then the player is on a surface and doesn't need to fall.
--If NO platform asnwers True, then the player falls.
----World calls the 'fall' function with the player's location
------'Fall' function calculates fall speed, and call's 'Move Player' function to change player's location.

Alright, I hope you get what I'm trying to say. I don't have time to clean up this post any more... maybe I'll try to later.

Share this post

Link to post
Share on other sites
Before you can create a platform and an object that reacts to it, you will need a graphics context (assuming that you want to be able to see them).

Typically you'll use a library for this (you can go lower and use the OS APIs, but this is much more tedious and much less cross-platform). Some common choices are SFML (which I find nicer if you're using C++) and SDL.

The libraries mentioned above will get you a window, let you draw things, and let you catch the user's input (try the SFML tutorials, they'll get you going with all of that).
As for the object responding to the platform: you can come up with simple forms of collision detection yourself, but as a beginner they will likely be limiting for you -- it will be much easier to use a physics engine that will handle collisions for you (and enable you to do many more things). Try Box2D.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this