Re-getting into C++ again

Started by
9 comments, last by cozzie 8 years, 10 months ago

Hi there fellows,

Some less then a year ago, I bought a book about the basics of C++. I had many

free time in those days, so I managed to learn about data types, functions, arrays, vectors,

pointers, classes and inheritance. Then I arrived at a chapter about dynamic memory. For me,

it was (and is) a hard chapter, but the main problem was that I didn't have enough time anymore to finish it.

So everytime I did some paragraphs, I couldn't program for weeks and I had to start over. But then, I literally

had no free time anymore.

So now I am here and, with the summer break coming, I really want to get back where I was. In the summer break,

I want to start right off with the chapter again and finish the book, so I can start making some small games. But I have

a problem: because I didn't program for such a long time, I forgot many things. Last time, I forgot that I had to

make a constructor and I even didn't knew for an instance, how to make a good use of If statements to get something done.

I obviously need to refresh everything, but if I need to restart with my book, I'm sure I will lose my courage (because I'm pretty for with it).

So my question is, what is the best way of getting back into C++ again and refresh my knowledge?

BTW: if you tell me to make some programs, could you tell me what kind of programs I can make, that will help me/be a very

good practice

Thanks.

Advertisement

I think going back through the book sounds good - it sounds like you didn't really make any games back then, so you're still in the learning phase.

There's an excellent book (in my opinion) that I've recommended to many aspiring games programmers called "Beginning C++ Through Games Programming". I believe it's up to the fourth edition now (I learnt from the second). I advise you give it a look if nothing else :)

As for making games... Start with something simple like Asteroids as you can learn basic vector math and level management. Then progress onto a 2D platformer (think of Mario, maybe add some basic AI). You can go from there to whatever you like after that.

Good luck!

BSc Computer Games Programming (De Montfort University) Graduate

Worked on Angry Birds Go! at Exient Ltd

Co-founder of Stormburst Studios

If you are starting from scratch, start by making simple ascii art games. Things like tic-tac-toe or word games. This way you won't get bogged down with how to render graphics. Once you understand how to program in c++ then you can start investigating different graphic api or game engines.

Thanks for the answers, butI think I asked the question in a bit a wrong way, because it seems like the answers

are not for my question.

I'm not looking for a way to get into programming/game programming, but I'm looking for

ways to re-get into programming and to refresh the programming concepts, I've learned, because

I didn't program for a long time and forgot a lot.

Thanks.

Thanks for the answers, butI think I asked the question in a bit a wrong way, because it seems like the answers

are not for my question.

I'm not looking for a way to get into programming/game programming, but I'm looking for

ways to re-get into programming and to refresh the programming concepts, I've learned, because

I didn't program for a long time and forgot a lot.

Thanks.

It seems that going through the book again, as Dezachu mentioned, would be very beneficial for you if you were previously making progress that way. Could you be a little more specific about what you're looking for? I stopped programming in C++ for a while, then returned to it, and I found that using the language to make various little applications (rock-paper-scissors, caesar cipher, surveys, guessing games) was the best way to refresh my knowledge. smile.png

So my suggestion is to try making things. They don't have to be games. Just write little applications using what you already know. When you come to a point where you want to do something but forgot how (ex. storing a number inside a variable), then you can always reference that chapter in your book.

I'm sorry, but I'm not exactly sure how to answer your question. happy.png I thought I'd give it go. Getting into programming again can be the same as learning how to program from the start, especially if you haven't looked at code in a long time! Please don't be afraid to start over from the beginning, watch tutorials on YouTube, or read through your book from the first chapter again. Even if you're thinking, "I already know how to do this" in the beginning of those tutorials, you'll eventually come across something you haven't seen before (because you mentioned that you haven't finished that book). Perhaps Bucky's tutorial series would be a good reference for you. I recommend checking out his playlist of C++ tutorials.

Pick a project (anything simple enough, such as tic-tac-toe or even math quiz) and do not worry so much about forgetting stuff (but make sure to use a good IDE and compiler). I forget stuff all the time, even though I program every day. When I do, my tools are there to remind me.

openwar - the real-time tactical war-game platform

Thanks,

Restarting with the book is no option for me, as I said. It will decourage me and eventually I will stop.

I like the idea of making programs I think. I started to do that, but I don't really know anymore what to make

(I just have no inspiration at the time). Could you maybe do some extra suggestions?

Thanks again.

I think the best way to get into anything is to pick something that "forces" you to use it a lot :)

So, considering this is a game development community, pick a game engine/framework that is written in C++ and go nuts.

It doesn't matter what kind of project you choose - pong or a simple RPG - as long as it manages to make you program in C++.

Too many projects; too much time


Restarting with the book is no option for me, as I said. It will decourage me and eventually I will stop.
I like the idea of making programs I think. I started to do that, but I don't really know anymore what to make
(I just have no inspiration at the time). Could you maybe do some extra suggestions?

Ah, sorry I missed that in your original post! I could suggest the MakingGamesWithBen channel on YouTube, if that's something you want to do.

Here are two ideas to get you started...

#1 Guess the Number

>>> The program generates a random number and asks the player to guess it within so many turns.


// Example output

Hi, I'm Rob! I'm thinking of a number between 1 and 10. Can you guess it in 3 turns?

PLAYER: 1

Nope! That's too small! Try again.

PLAYER: 7

Nope! That's too big! Try again.

PLAYER: 3

That's it! I was thinking of the number 3! You guessed my number in 3 turns!

#2 Text-Based RPG

>>> The player has stats and items. He or she may increase them by doing various actions.


// Example output
+-------------------------------------------------------+
| CLASS: FIGHTER | HP: 84 | ATK: 40 | DEF: 32 | EXP: 25 |
+-------------------------------------------------------+

What will you do?

1 - Enter a dungeon
2 - Purchase items from a shop
3 - Take a quest

PLAYER: 2

Merchant: Welcome young adventurer! What will you buy today?

+----------------------------------------------------+-----------------+
|                       SHOP                         | Your Gold: 2585 |
+----------------------------------------------------+-----------------+
| 1 - Mythril Sword ---------------------- 1500 Gold |
| 2 - Adamantine Saber ------------------- 2450 Gold +-----------------+
| 3 - Claymore --------------------------- 3600 Gold | 4 - Exit Shop   |
+----------------------------------------------------+-----------------+

PLAYER: 1

Merchant: You already own [1] MYTHRIL SWORD.

PLAYER: 3

Merchant: You cannot afford that!

PLAYER: 2

YOU OBTAINED THE [ADAMANTINE SABER]!
YOU NOW HAVE [135 Gold]!

PLAYER: 4

Merchant: Come again soon!

+-------------------------------------------------------+
| CLASS: FIGHTER | HP: 84 | ATK: 40 | DEF: 32 | EXP: 25 |
+-------------------------------------------------------+

What will you do?

1 - Enter a dungeon
2 - Purchase items from a shop
3 - Take a quest

PLAYER: 1

You are inside a dungeon...

MONSTER ENCOUNTER!

 +------------+ +--------------+ +--------------+
 | 1 - Attack | | 2 - Use Item | | 3 - Run Away |
 +------------+ +--------------+ +--------------+

PLAYER: 1

You attack for 43 damage!

You have defeated the monster!

GAINED 56 EXP!

/// and so on

Starting with text-based apps is really helpful. You could also make quizzes, hangman, shop sims, chatbots, choose your own adventure games...anything, really.

Let's be honest. If dynamic memory gave you an issue, you will eventually hit that issue again. If the book deters you from programming it is a sign that you need a different book or that C++ is complex enough to put it aside and learn other languages before C++. That said, a simple google search gives you language specific pages for projects:

C++ Google Results: http://tinyurl.com/pz6n679

Programming Project Ideas: http://tinyurl.com/nkmoasv

Even a book of them: http://www.coderslexicon.com/downloads/the-programmers-idea-book/

Programming works best when you are part of a team or have your own projects you want to do. It is hard to keep motivated on code that doesn't interest you personally.

This topic is closed to new replies.

Advertisement