Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I have been working on Pong for two days. This is my progress.  (Read 4398 times)

0 Members and 2 Guests are viewing this topic.

deeup511

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hey. I attempted to make a Pong project using multiple header and class files. I tried doing it all in one but it got really messy. This is what I have so far. I have no clue why it is not recognizing the functions from the other headers. Can someone point me in the right direction? I don't know how to fix the paddles.

https://github.com/Devin8/Pong
« Last Edit: August 10, 2015, 09:35:32 am by deeup511 »

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: I have been working on Pong for two days. This is my progress.
« Reply #1 on: August 10, 2015, 09:34:06 am »
So what do have so far then? We can't guess how you implemented your stuff, and without any code or a specific question, you won't get any answer.
Failing to succeed does not mean failing to progress!

deeup511

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: I have been working on Pong for two days. This is my progress.
« Reply #2 on: August 10, 2015, 09:35:19 am »
https://github.com/Devin8/Pong

FORGOT TO POST IT SORRY!

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: I have been working on Pong for two days. This is my progress.
« Reply #3 on: August 10, 2015, 12:59:26 pm »
Why is main.h declaring main as a class?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: I have been working on Pong for two days. This is my progress.
« Reply #4 on: August 10, 2015, 09:43:01 pm »
Besides the weird main.h file, you lack some important fundamental C++ knowledge. Before you can use the function, you have to make an instance of your class and call the function then for that instance. Also in your pong game it would be a better choice to make a Paddle instead of a Paddles class and make one instance per player. (For reasons that should be clear after you progress further).

Read up on classes (and other basic C++ topics), they are so important and crucial in most projects, you don't want to miss them :)
Failing to succeed does not mean failing to progress!

deeup511

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: I have been working on Pong for two days. This is my progress.
« Reply #5 on: August 11, 2015, 02:17:22 am »
I didn't touch anything in main.h It was automatically like that.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: I have been working on Pong for two days. This is my progress.
« Reply #6 on: August 11, 2015, 04:24:21 am »
Well, at least it's not linked  ;)

Did you fix the things that Geheim told you about?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: I have been working on Pong for two days. This is my progress.
« Reply #7 on: August 12, 2015, 08:03:56 am »
omg .. you just remind me of myself a year ago. the "stdafx.h"  was my companion for couple of months until i realized that's it useless when i had my first project with multiple files. if you are using VC10 or VC08 throw it away believe me it doesn't worth it. i just installed VC14 with C++14 supported. i'm now toying with std::bind and lambda.  8)

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: I have been working on Pong for two days. This is my progress.
« Reply #8 on: August 12, 2015, 08:12:41 pm »
Best thing to avoid all of those automatic creations that you might not want or even realise are there is:
Create an Empty Project
It really cleans things up when the only that is there is stuff you put there on purpose.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: I have been working on Pong for two days. This is my progress.
« Reply #9 on: August 13, 2015, 11:33:19 pm »
Quote
you lack some important fundamental C++ knowledge
I'm sorry, but I would take this as advice.

You have 3 options (as far as I know):
- Learn from the internet (it will require knowledge of using google) about C++. Now this is not really recommended, since you will likely pick up many bad habits while doing so. But it's free, kinda.
- Learn from a good C++ Book for Beginners (check here: https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). It's not free, kinda.
 But the quality of information is definately better.
- Continuing to attempt game programming without working on your basic C++ Skills: not productive.

What you will need (including, but not limited to):
- A basic sense for logic, maths. Don't get me wrong, you don't have to be some super-smart guy or gal, but some basic understanding really helps.
- Motivation: You won't learn it all in a day, or a week. Even a month is unlikey. In fact, you'll never stop learning. It helps to have a realistic goal.
    Yes: "I want to make my own pong clone with C++ and SFML".
     No: "I want to make the next-gen AAA MMORPG".

Good luck and may the bytes be ever in your favor
Raincode

 

anything