1
General discussions / Problems with gcc 4.6
« on: April 09, 2011, 10:16:29 am »
Ok. I think I'll do that. Thanks for your quick answer.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
/usr/include/SFML/System/ResourcePtr.inl:31: error: ‘NULL’ was not declared in this scope
void myFunction(); // This is the declaration
int main() {
...
myFunction(); // We can call our function here now
...
}
void myFunction() {
// Code for myFunction goes here
...
}
Also where does player + enemy score go. I've finally got a scoring system that i'm pleased with but i don't know where to put it. Would I be correct in thinking that it would be best in the while loop.
Side note: Should I
1) Make the walls in like paint and just load them as a sprite.
2) Construct them using a simple shape made by SFML.
3) Do Number 1 but load them as an Image?
Enemy *someEnemy = EnemyFactory::create("Robot", "red", 100);
float Left = 0.f;
p.s. also just a little question about sfml. I am reading the tutorials and I keep on seeing this " .f " - what does it mean?
1) How can I get the player sprite to face the mouse?
void Player::onUpdate() {
Input *input = Input::getInstance();
sf::Vector2f mouseToPlayer = input->getMousePosition() - getPosition();
float facingAngle = atan(mouseToPlayer.x/mouseToPlayer.y);
if(mouseToPlayer.x == 0 && mouseToPlayer.y == 0)
facingAngle = 0;
facingAngle *= 180/3.14159; // Convert to degrees
// atan() returns an angle between 0-180 therefore it needs an offset of 180
// when it is in the negative-Y quadrants
if(mouseToPlayer.y >= 0) {
facingAngle += 180;
}
setAngle(facingAngle);
...
2) how can I get the Zombies to go towards the player?
3) How should I do the maps? Are their any editors that would work best for my needs (medium sized maps with collision and as the player moves, it scrolls.)