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

Show Posts

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.


Messages - wtf

Pages: [1]
1
General / CMD Console!?
« on: February 20, 2012, 11:59:13 pm »
Thank you for your help. the problem has been resolved.

2
General / [SFML 2.0] Collision
« on: February 20, 2012, 11:52:33 pm »
I am using SFML 2.0, and i need help with the collision class. i am attempting to use the collision class posted on the SFML website http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection

Due to the new updates of SFML 2.0 it will not work so could some one help me fix this by providing what needs to be changed.

Things that do not work:
* TransformToGlobal()
* Offset()
* GetSubRect()
* GetWidth()
* GetHeight()
* TransformToLocal()
* GetPixel()
* GetSize()

Please help with the problums, or inform me of a alternate method.
-Thank you :)

3
Window / Need Help!!!
« on: November 26, 2011, 08:29:25 pm »
How come when ever i create a new class a new window pops up which is white and i cannot control. i even made a blank class with nothing in it and it still created another window. i am using SFML 2.0, but i don't recall problems like this on SFML 1.6.

Can someone please help me fix this?

4
General / CMD Console!?
« on: November 26, 2011, 12:26:18 am »
Hello, i am using Microsoft Visual C++ 2010 with SFML 2.0 on a Windows 7 computer and for some reason a console window pops up when ever i try to run any of my projects and i cant figure out a way to make it stop! Can someone please help me with my problem!?



5
System / Time and Date?
« on: September 11, 2011, 04:40:06 am »
I am trying to make a calendar/clock in SFML, but I don't know how to get the time or the date. So if anyone knows how to do this please tell me.
I am using SFML 2.0 with Visual C++ 2010 on a Windows 7 system if that helps at all.

6
General / Why does this happen!?!?!?!?!?
« on: August 14, 2011, 08:08:40 pm »
I also found a second window pops up for no apparent reason, if this may also be a part of the problem

7
General / Why does this happen!?!?!?!?!?
« on: August 12, 2011, 11:39:30 pm »
I am using SFML 2.0
my video card is "AMD M880G with ATI Mobility Radeon HD 4250" i think...
I am using MSVC++ 2010 Express

8
General / Why does this happen!?!?!?!?!?
« on: August 12, 2011, 11:00:10 pm »
When ever you close the SFML window it comes up with this error



and opends "WglContext.cpp".

But when you close the CMD window or click "Stop Debugging" instead of closing the SFML window it doesn't do this.

Does any one know how to fix this?

9
General / Timer
« on: August 09, 2011, 08:59:46 pm »
I was wondering how i could make a timer for how long a program runs before closing. If anyone could help me do this please  do so.

10
General / ERROR!
« on: August 03, 2011, 08:47:59 am »
Thank you for your help. i now have it working properly.

11
General / ERROR!
« on: August 03, 2011, 08:23:47 am »
Quote from: "Lo-X"
I think it comes from there :

Code: [Select]
Heart[2].SetImage(heart1);
Heart[2].Scale(2.0f, 2.0f);


Look at the declaration :

Code: [Select]
sf::Sprite Heart[2];


What exactly do you mean by this?

12
General / ERROR!
« on: August 03, 2011, 08:08:51 am »
Here is my whole source code. Hopefully you can help me with this.

Main.cpp
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Engine.h"

int main()
{
    Engine Game;
    Game.Run();

    return EXIT_SUCCESS;
}


Engine.h
Code: [Select]
#ifndef ENGINE_H
#define ENGINE_H


class Engine
{
    public:
        Engine();
        ~Engine();

        void Init();
        void HandleEvents();
        void Update();
        void Render();
        void Cleanup();

        void Run();

    protected:
    private:
sf::RenderWindow App;
        sf::Event Event;
        sf::Clock Clock;
        int fps;
};

#endif


Engine.cpp
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Engine.h"
#include "GUI.h"

const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
const int SCREEN_BPP = 32;

GUI gui;

Engine::Engine():
fps(0)
{
    App.Create(sf::VideoMode(SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BPP), "Engine");
    sf::Sleep(1.f);
}

Engine::~Engine()
{

}

void Engine::Init()
{

}

void Engine::HandleEvents()
{
    if(Event.Type == sf::Event::Closed)
        App.Close();
}

void Engine::Update()
{
    fps++;
    if(Clock.GetElapsedTime() >= 1.f)
    {
       fps++;
if(Clock.GetElapsedTime() >= 1.f)
{
int Framerate = (1.f / Clock.GetElapsedTime()) * 1000;
std::cout << "FPS: " << Framerate<< std::endl;
Clock.Reset();
}
    }
}

void Engine::Render()
{
    App.Clear(sf::Color(0,0,0));
App.Draw(gui.Rupee_GUI);
App.Draw(gui.Rupee_Amount);
App.Draw(gui.Arrow_GUI);
App.Draw(gui.Arrow_Amount);
App.Draw(gui.Bomb_GUI);
App.Draw(gui.Bomb_Amount);
App.Draw(gui.Heart[2]);
App.Display();
}

void Engine::Cleanup()
{

}

void Engine::Run()
{
    Init();
    while(App.IsOpened())
    {
        while(App.PollEvent(Event))
        {
            HandleEvents();
        }
        Update();
        Render();
    }
    Cleanup();
}


GUI.h
Code: [Select]
#ifndef GUI_H
#define GUI_H

class GUI
{
public:
GUI(void);
~GUI(void);

sf::Text Rupee_Amount;
sf::Image rupee_GUI;
sf::Sprite Rupee_GUI;

sf::Text Arrow_Amount;
sf::Image arrow_GUI;
sf::Sprite Arrow_GUI;

sf::Text Bomb_Amount;
sf::Image bomb_GUI;
sf::Sprite Bomb_GUI;

sf::Image heart1;
sf::Image heart2;
sf::Image heart3;
sf::Image heart4;
sf::Image heart5;

int i;
sf::Sprite Heart[2];

int Rupees;
int Bombs;
int Arrows;

private:

};

#endif


GUI.cpp
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include <sstream>
#include "GUI.h"

std::string IntToString (int number);

GUI::GUI(void)
{
sf::Font Font;
Font.LoadFromFile("Fonts/RetGanon.ttf");

// RUPEES**********************************************************

// IMAGE
rupee_GUI.LoadFromFile("Sprites/Rupee_Gui_Img.png");
Rupee_GUI.SetImage(rupee_GUI);

Rupee_GUI.SetPosition(30.0f, 558.0f);

// TEXT
std::string Rupees_Text = IntToString(Rupees);

Rupee_Amount.SetString(Rupees_Text);
Rupee_Amount.SetCharacterSize(16u);
Rupee_Amount.SetStyle(sf::Text::Bold);
Rupee_Amount.SetColor(sf::Color(252,253,255));

Rupee_Amount.Move(45.0f, 554.0f);

// ARROWS **********************************************************

// IMAGE
arrow_GUI.LoadFromFile("Sprites/Arrow_GUI.png");
Arrow_GUI.SetImage(arrow_GUI);

Arrow_GUI.SetPosition(355, 5);

// TEXT
std::string Arrow_Text = IntToString(Arrows);

Arrow_Amount.SetString(Arrow_Text);
Arrow_Amount.SetCharacterSize(16u);
Arrow_Amount.SetStyle(sf::Text::Bold);
Arrow_Amount.SetColor(sf::Color(252,253,255));

Arrow_Amount.Move(350,23);

// Bombs *************************************************************

// IMAGE
bomb_GUI.LoadFromFile("Sprites/Bomb_GUI.png");
Bomb_GUI.SetImage(bomb_GUI);

Bomb_GUI.SetPosition(450,7);

// TEXT
std::string Bomb_Text = IntToString(Bombs);

Bomb_Amount.SetString(Bomb_Text);
Bomb_Amount.SetCharacterSize(16u);
Bomb_Amount.SetStyle(sf::Text::Bold);
Bomb_Amount.SetColor(sf::Color(252,253,255));

Bomb_Amount.Move(445,23);

// HARTS ***************************************************************

heart1.LoadFromFile("Sprites/Hart1.png");
heart2.LoadFromFile("Sprites/Hart2.png");
heart3.LoadFromFile("Sprites/Hart3.png");
heart4.LoadFromFile("Sprites/Hart4.png");
heart5.LoadFromFile("Sprites/Hart5.png");

Heart[2].SetImage(heart1);

Heart[2].Scale(2.0f, 2.0f);

int x = 761;
int y = 20;
for(int i=0; i < 2; i++)
{
Heart[i].SetPosition(x, y);
x -= 20;
}
/*Heart1.SetPosition(761, 20);
Heart2.SetPosition(741, 20);
Heart3.SetPosition(721, 20);*/
}

GUI::~GUI(void)
{
}

std::string IntToString (int number)
{
std::ostringstream oss;

if(number <= 9)
{
oss << "00" << number;
}
else if(number <= 99 && number >= 10)
{
oss << "0" << number;
}
else if(number <= 999 && number >= 100)
{
oss << number;
}

  return oss.str();
}

13
General / ERROR!
« on: August 03, 2011, 07:38:52 am »


I believe it might be this part of the code...
Code: [Select]
int x = 761;
int y = 20;
for(int i=0; i < 2; i++)
{
Heart[i].SetPosition(x, y);
x -= 20;
}


Can anyone PLEASE help me with this!

14
Graphics / Collision Class
« on: July 30, 2011, 07:28:03 pm »
I think they should have included the collision class in the sfml library.

15
General / SFML/Box2D Help
« on: July 30, 2011, 05:21:32 am »
I am trying to set up collisions for my game using SFML and Box2D. If anyone can help me with this or know of a good tutorial please let me know. (I am a absolute beginner to Box2D)

Pages: [1]