Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

initializing an instance field of a vector

$
0
0

well I am using a vector to resolve collision detection with multiple objects, I am having some problems initializing the instance fields in my code. I have googled “initializing instance fields using c++”  but have got little input, I know this is a simple question but I would some clarification on it. my code compiles just fine. I am trying to implement collision detection on vertical side scroller which has multiple sprites to shoot at. this is just some stubbed out code in c++.

#include <iostream>
#include <vector>

using namespace std;

class Brick
{
public:
	float x;
	float y;
	float brick_x …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>