Jump to content

  • Log In with Google      Sign In   
  • Create Account


[SFML] Breakout Help :(


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
16 replies to this topic

#1 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 05:26 PM

Today, I started programming breakout. I have the main functionality done, but whenever I run the program it gives me the error:
0xC0000005: Access violation writing location 0x00000005
in Visual C++ 2010 Express Edition. Here's the Rest of the Code:
Paddle.h:
#pragma once
class Paddle
{
public:
Paddle(float speedx, sf::Image &PaddleImage);
~Paddle(void);
void Update(sf::RenderWindow &Window);
void Draw(sf::RenderWindow &Window);
sf::FloatRect GetCollision();
sf::Image GetPaddleImage();
sf::Sprite GetPaddleSprite();
float GetWidth();
float GetHeight();
float GetSpeedX();
private:
sf::FloatRect Collision;
sf::Image PaddleImage;
sf::Sprite PaddleSprite;
float Width;
float Height;
float speedx;
};
Paddle.cpp:
#include "StdAfx.h"
#include "Paddle.h"
//Constructor sets all the values, we have no memory allocated so Destructor does nothing;
Paddle::Paddle(float speedx, sf::Image &PaddleImage)
{
this->speedx = speedx;
this->PaddleImage = PaddleImage;
PaddleSprite.SetImage(this->PaddleImage);
PaddleSprite.Move(350, 750);
Width = this->PaddleImage.GetWidth();
Height = this->PaddleImage.GetHeight();
}

Paddle::~Paddle(void)
{
}
//Updates the floatrects position to test for, well, collision and checks for input;
void Paddle::Update(sf::RenderWindow &Window)
{
Collision.Left = PaddleSprite.GetPosition().x;
Collision.Top = PaddleSprite.GetPosition().y;
Collision.Right = PaddleSprite.GetPosition().x + Width;
Collision.Bottom = PaddleSprite.GetPosition().y + Height;
if (Window.GetInput().IsKeyDown(sf::Key::Left) && PaddleSprite.GetPosition().x > 0) PaddleSprite.Move(-speedx * Window.GetFrameTime(), 0);
else if (Window.GetInput().IsKeyDown(sf::Key::Right) && PaddleSprite.GetPosition().x < 700) PaddleSprite.Move(speedx * Window.GetFrameTime(), 0);
}
//NECESSARY GET FUNCTIONS;
void Paddle::Draw(sf::RenderWindow &Window)
{
Window.Draw(PaddleSprite);
}
sf::FloatRect Paddle::GetCollision()
{
return Collision;
}
sf::Image Paddle::GetPaddleImage()
{
return PaddleImage;
}
sf::Sprite Paddle::GetPaddleSprite()
{
return PaddleSprite;
}
float Paddle::GetWidth()
{
return Width;
}
float Paddle::GetHeight()
{
return Height;
}
float Paddle::GetSpeedX()
{
return speedx;
}
Ball.h:
#pragma once
class Paddle;
class Block;
class Ball
{
public:
Ball(sf::Image &BallImage, float speedx, float speedy);
~Ball(void);
void Update(sf::RenderWindow &Window);
void Draw(sf::RenderWindow &Window);
void Test_For_Collision(sf::FloatRect LeftWall, sf::FloatRect RightWall, sf::FloatRect Top, sf::FloatRect Bottom, Paddle MyPaddle, Block Blocks[20]);
sf::FloatRect GetCollision();
sf::Image GetBallImage();
sf::Sprite GetBallSprite();
float GetSpeedX();
float GetSpeedY();
private:
sf::FloatRect Collision;
sf::Image BallImage;
sf::Sprite BallSprite;
float speedx, speedy, Width, Height;
};
Ball.cpp:
#include "StdAfx.h"
#include "Ball.h"

Ball::Ball(sf::Image &BallImage, float speedx, float speedy)
{
Width = 25;
Height = 25;
this->speedx = speedx;
this->speedy = speedy;
this->BallImage = BallImage;
BallSprite.SetImage(this->BallImage);
}

Ball::~Ball(void)
{
}
void Ball::Update(sf::RenderWindow &Window)
{
BallSprite.Move(speedx * Window.GetFrameTime(), speedy * Window.GetFrameTime());
Collision.Left = BallSprite.GetPosition().x;
Collision.Top = BallSprite.GetPosition().y;
Collision.Right = BallSprite.GetPosition().x + Width;
Collision.Bottom = BallSprite.GetPosition().y + Height;
}
void Ball::Draw(sf::RenderWindow &Window)
{
Window.Draw(BallSprite);
}
void Ball::Test_For_Collision(sf::FloatRect LeftWall, sf::FloatRect RightWall, sf::FloatRect Top, sf::FloatRect Bottom, Paddle MyPaddle, Block Blocks[20])
{
for (int index = -1; index < 19; ++index)
{
  if (Collision.Intersects(Blocks[index].GetCollision()) && Blocks[index].GetIsHit() == false)
  {
   speedy = -speedy;
   Blocks[index].SetIsHit(true);
  }
}
if (Collision.Intersects(MyPaddle.GetCollision()))
{
  speedy = -speedy;
}
if (Collision.Intersects(LeftWall))
{
  speedy = -speedy;
}
if (Collision.Intersects(RightWall))
{
  speedy = -speedy;
}
if (Collision.Intersects(Top))
{
  speedx = -speedx;
}
if (Collision.Intersects(Bottom))
{
  speedx = -speedx;
}
}
sf::FloatRect Ball::GetCollision()
{
return Collision;
}
sf::Image Ball::GetBallImage()
{
return BallImage;
}
sf::Sprite Ball::GetBallSprite()
{
return BallSprite;
}
float Ball::GetSpeedX()
{
return speedx;
}
float Ball::GetSpeedY()
{
return speedy;
}
Block.h:
#pragma once
class Block
{
public:
//Constructors and Destructors
Block(void);
Block(float movex, float movey, sf::Image &BlockImage);
~Block(void);
//Member Functions
void Initialize(float movex, float movey, sf::Image &BlockImage);
void Draw(sf::RenderWindow &Window);
//Get Functions
sf::FloatRect GetCollision();
sf::Image GetBlockImage();
sf::Sprite GetBlockSprite();
float GetWidth();
float GetHeight();
bool GetIsHit();
void SetIsHit(bool x);
//No set functions (I don't want to be able to change values outside of constructor/initialize function)
private:
sf::FloatRect Collision;
sf::Image BlockImage;
sf::Sprite BlockSprite;
float Width;
float Height;
bool IsHit;
};
Block.cpp:
#include "StdAfx.h"
#include "Block.h"

Block::Block(void)
{
}

Block::~Block(void)
{
}
Block::Block(float movex, float movey, sf::Image &iBlockImage)
{
Width = 30;
Height = 10;
IsHit = false;
BlockImage = iBlockImage;
BlockSprite.SetImage(BlockImage);
BlockSprite.Move(movex, movey);
Collision.Left = movex;
Collision.Top = movey;
Collision.Right = movex + BlockImage.GetWidth();
Collision.Bottom = movey + BlockImage.GetWidth();
}
void Block::Initialize(float movex, float movey, sf::Image &BlockImage)
{
Width = 30;
Height = 10;
IsHit = false;
this->BlockImage = BlockImage;
BlockSprite.SetImage(this->BlockImage);
BlockSprite.Move(movex, movey);
Collision.Left = movex;
Collision.Top = movey;
Collision.Right = movex + this->BlockImage.GetWidth();
Collision.Bottom = movey + this->BlockImage.GetWidth();
}
void Block::Draw(sf::RenderWindow &Window)
{
if (IsHit == false)
{
  Window.Draw(BlockSprite);
}
else if (IsHit == true)
{
  return;
}
else
{
  std::cout << "The Block you Tried to Draw to the Window In Member Function Block::Draw() was not Initialized!/n";
}
}
sf::FloatRect Block::GetCollision()
{
return Collision;
}
sf::Image Block::GetBlockImage()
{
return BlockImage;
}
sf::Sprite Block::GetBlockSprite()
{
return BlockSprite;
}
float Block::GetWidth()
{
return Width;
}
float Block::GetHeight()
{
return Height;
}
bool Block::GetIsHit()
{
return IsHit;
}
void Block::SetIsHit(bool x)
{
IsHit = x;
}
Main.cpp:
// BREAKOUT.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Breakout!");
sf::Event Event;
sf::Image iRedPaddle;
sf::Image iGreenBall;
sf::Image iBlock;
sf::FloatRect LeftWall(0, 0, 1, 600);
sf::FloatRect RightWall(800, 0, 799, 600);
sf::FloatRect Top(0, 0, 800, 1);
sf::FloatRect Bottom(0, 599, 800, 600);
if (!iRedPaddle.LoadFromFile("images/RedPaddle.png"))
  std::cout << "Could not load file: RedPaddle.png in folder: images" << std::endl;
if (!iGreenBall.LoadFromFile("images/GreenBall.png"))
  std::cout << "Could not load file: GreenBall.png in folder: images" << std::endl;
if (!iBlock.LoadFromFile("images/Block.png"))
  std::cout << "Could not load file: Block.png in folder: images" << std::endl;
Paddle PlayerPaddle(200, iRedPaddle);
Ball AI_Ball(iGreenBall, 200, 200);
Block TheBoard[20];
for (int x = 80, y = 25, index = 5; x < 200, index > 0; x = x+20, --index)
{
  TheBoard[index].Initialize(x, y, iBlock);
}
for (int x = 80, y = 35, index = 10; x < 200, index > 5; x = x+20, --index)
{
  TheBoard[index].Initialize(x, y, iBlock);
}
for (int x = 80, y = 45, index = 15; x < 200, index > 10; x = x+20, --index)
{
  TheBoard[index].Initialize(x, y, iBlock);
}
for (int x = 80, y = 55, index = 20; x < 200, index > 15; x = x+20, --index)
{
  TheBoard[index].Initialize(x, y, iBlock);
}
while (App.IsOpened())
{
  while (App.GetEvent(Event))
  {
   if (Event.Type == sf::Event::Closed)
    App.Close();
  }
  AI_Ball.Update(App);
  AI_Ball.Test_For_Collision(LeftWall, RightWall, Top, Bottom, PlayerPaddle, TheBoard);
  PlayerPaddle.Update(App);
  App.Clear(sf::Color::White);
  AI_Ball.Draw(App);
  PlayerPaddle.Draw(App);
  for (int index = -1; index < 19; ++index)
   TheBoard[index].Draw(App);
  App.Display();
}
return 0;
}
I'm almost certain it has something to do with arrays and references, so I'ms till looking. I read around and it said that this is only an error in Visual C++ because of a problem with them, but I'm not sure.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


Sponsor:

#2 Radikalizm   Crossbones+   -  Reputation: 2837

Like
0Likes
Like

Posted 30 September 2012 - 05:30 PM

Could you tell where in your code and when this error occurs? Just dumping a ton of code and a fairly vague error message doesn't really help here.

EDIT:

Also try to add some spacing and formatting to your code, and maybe add some documentation here and there as this code is pretty hard to read as it is.
Documenting code is also just good a good practice, even if it is just for fairly simple or trivial code. You don't want to have to figure out what a function does after not looking at it for a couple of months

Edited by Radikalizm, 30 September 2012 - 05:33 PM.

I gets all your texture budgets!


#3 EngineProgrammer   Members   -  Reputation: 295

Like
1Likes
Like

Posted 30 September 2012 - 05:37 PM

0xC0000005: Access violation writing location 0x00000005

I haven't looked into your code but this means 2 things.

1) You are trying to read on an address where no object has been created.
2) You are reading out of an array. example: m_Array[max+1];

I think it's here:
void Ball::Test_For_Collision(sf::FloatRect LeftWall, sf::FloatRect RightWall, sf::FloatRect Top, sf::FloatRect Bottom, Paddle MyPaddle, Block Blocks[20])
{
for (int index = -1; index < 19; ++index)
{
  if (Collision.Intersects(Blocks[index].GetCollision()) && Blocks[index].GetIsHit() == false)
  {
   speedy = -speedy;
   Blocks[index].SetIsHit(true);
  }
}

You start with index -1, but array[-1] is out of its memory. So memory access violation.


~EngineProgrammer

#4 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 05:42 PM

But it increments it to zero on the first loop, negating that problem. I did try your fix though, but it didn't work. I'll start trying to comment my code and add whitespace, but still, this error is eluding my face off :(

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#5 Radikalizm   Crossbones+   -  Reputation: 2837

Like
0Likes
Like

Posted 30 September 2012 - 05:49 PM

The increment happens at the end of a loop iteration, not at the beginning, so you should initialize it at a value of 0 and not at -1 as that will indeed cause an access violation.

I gets all your texture budgets!


#6 EngineProgrammer   Members   -  Reputation: 295

Like
0Likes
Like

Posted 30 September 2012 - 05:51 PM

So, the initialized value( -1 ) will be the first value inside the for-loop. It's tricky because you see ++index in the same line.

You can see a for loop like this:

int index = 0;
do
{
  // your collision
  // increment index
} while( index < 19 )

Also, just noticed:
void Ball::Test_For_Collision(sf::FloatRect LeftWall, sf::FloatRect RightWall, sf::FloatRect Top, sf::FloatRect Bottom, Paddle MyPaddle, Block Blocks[20]) {...}

Block Blocks[20] is a parameter of you. This parameter creates 20 new Blocks that has not been initialized. Meaning they will give a break error indeed because you are asking their Collosions but the object itself hasn't been created...

Block& Blocks[] -> this should fix it. If not, Block* pBlocks will fix it then.


~EngineProgrammer

#7 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 05:56 PM

I have far more detail on the problem now:
It can't read from a location I'm trying to get it to read from. It's changed from error 0x00000005 to 0xccccccd0.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#8 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 05:59 PM

Okay, I fixed all the for loops, but now it says an array of references is illegal.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#9 EngineProgrammer   Members   -  Reputation: 295

Like
0Likes
Like

Posted 30 September 2012 - 06:02 PM

use the Block* pBlocks?

I don't work with dynamic or static arrays so kinda forgot what I can do and cannot do with them. Posted Image

#10 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:03 PM

How would I implement that:
Block* pBlocks[] doesn't work either.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#11 EngineProgrammer   Members   -  Reputation: 295

Like
0Likes
Like

Posted 30 September 2012 - 06:05 PM

Look at my code, look at your code, now look back at my code, and back at your code......

I do Block* pBlocks !!
Not Block* pBlocks[[[[[[[[....]]]]]]]] Posted Image

#12 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:08 PM

This is my error code now:
1>------ Build started: Project: BREAKOUT, Configuration: Debug Win32 ------
1> stdafx.cpp
1> Ball.cpp
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(38): error C2065: 'Blocks' : undeclared identifier
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(38): error C2228: left of '.GetCollision' must have class/struct/union
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(38): error C2065: 'Blocks' : undeclared identifier
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(38): error C2228: left of '.GetIsHit' must have class/struct/union
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(41): error C2065: 'Blocks' : undeclared identifier
1>c:\users om\documents\visual studio 2010\projects\breakout\ball.cpp(41): error C2228: left of '.SetIsHit' must have class/struct/union
1> BREAKOUT.cpp
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(29): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(29): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(34): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(34): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(39): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(39): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(43): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>c:\users om\documents\visual studio 2010\projects\breakout\breakout.cpp(43): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1> Generating Code...
1> Skipping... (no relevant changes detected)
1> Paddle.cpp
1> Block.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
(Ignore the conversion problems, that's not a real bug it happens for a reason!)

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#13 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:10 PM

I fixed it so those errors aren't happening, but now it gives me the same 0xccccccd0 exception error?

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#14 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:15 PM

Dang, I'm so glad I wrote some error code that prints out if the block I'm printing on is uninitialized. I was acting on a block that was uninitialized. Now to figure it out.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#15 EngineProgrammer   Members   -  Reputation: 295

Like
0Likes
Like

Posted 30 September 2012 - 06:16 PM

Do you know why this happens? Because you are thinking I'm going to handle over all the code..

Block* pBlocks, you can clearly see a ' * ' in my code.
This is a dereference. Or in other words, this is a pointer. It stores an address of an object it's location.

http://www.cplusplus...orial/pointers/

I found 2 errors, I can't find any error at the moment. Try using break points. Put some breakpoints in your main functions and go over the methods one by one. When you get the break error after jumping over a method, it means you are doing some strange stuff inside that method.


~EngineProgrammer

#16 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:18 PM

Okay, the problem was that I was starting at Blocks[20], which meant that it was not calling the function correctly, and luckily I TOLD it to print out an error message if I did that, but I just forgot about it. #facepalm

Edited by superman3275, 30 September 2012 - 06:19 PM.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#17 superman3275   Crossbones+   -  Reputation: 2011

Like
0Likes
Like

Posted 30 September 2012 - 06:20 PM

I fixed it, I'm sorry I tried to do that, but it didn't work because that wasn't the problem. Sorry.
EDIT: I don't understand why I didn't just make the array of blocks member variables of the ball class, considering the ball was going to be the only other object interacting with them. My next goal: Change the code to make the Block array part of the ball class.

Edited by superman3275, 30 September 2012 - 06:47 PM.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS