HeyHo liebe Leser/innen.
Da bin ich mal wieder mit meiner Frage
Also ich wollte meine Klasse in .cpp und .hpp unterteilen.
Was mache ich falsch?
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//shoot.cpp
#include "shoot.h"
#include <SFML/Graphics.hpp>
C_Shot::C_Shot(const float Xpos,const float Ypos)
{
m_xPosition = Xpos;
m_yPosition = Ypos;
m_Speed = 500.f;
m_Damage = 1;
}
void C_Shot::update(sf::RenderWindow &window)
{
m_xPosition = m_Speed * window.GetFrameTime();
}
void C_Shot::draw(sf::RenderWindow &window)
{
window.Draw(sf::Shape::Rectangle(m_xPosition/2-1.5, m_yPosition-1, m_xPosition/2+1.5, m_yPosition-13, sf::Color::Yellow));
}
|
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#ifndef _shoot_H
#define _shoot_H
#include <SFML\Graphics.hpp>
class C_Shot
{
private:
float m_xPosition;
float m_yPosition;
float m_Speed;
unsigned int m_Damage;
public:
C_Shot(const float Xpos,const float Ypos);
void update(sf::RenderWindow &window);
void draw(sf::RenderWindow &window);
}
#endif
|
Ich kann den Compiler ohne Fehler nicht starten, weiß nicht warum
EDIT: Problem gelöst, sry dass ich so ungeduldig war, es fehlte ein ";"
KANN GESCHLOSSEN WERDEN, NOCHEINMAL ENTSCHULDIGUNG.