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 - TajiTakeo

Pages: [1]
1
General / Re: Help!
« on: April 09, 2013, 10:36:17 pm »
I will keep that in mind. Thanks for reply Nexus :)

2
General / Re: Help!
« on: April 09, 2013, 06:47:01 pm »
Ok! i've uploaded the code on github.
https://github.com/TajiTakeo/Ludowicus-Motor-A1

3
General / Re: Help!
« on: April 08, 2013, 10:38:19 pm »
Thank you for taking your time to help me  ;D
I am now using a while loop instead of if-statement.

Here is the code you asked for.
I will now check up on the links you gave me :)

#ifndef CONTROLS_H
#define CONTROLS_H

#include "data.hpp"

class movement
{
        public:

                void moveinit()
                {
                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
                        {
                                Data.player.move(0, -2);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
                        {
                                Data.player.move(0, 2);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                        {
                                Data.player.move(-2, 0);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                        {
                                Data.player.move(2, 0);
                        }
                }

}Movement;

class camera : public sf::View
{
        public:

                void camerainit()
                {
                        float X = Data.player.getPosition().x;
                        float Y = Data.player.getPosition().y;
                        sf::View::setCenter(X,Y);
                }

}Camera;

class buttons
{
        public:

                void buttonsinit()
                {
                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                        {
                                app.window.close();
                        }

                }
}Buttons;


#endif
 

4
General / Help!
« on: April 08, 2013, 09:48:47 pm »
I put my question here because I don't really know where else to put it.
I have a weird problem that i've never had before, I can't find a soulution to the problem.
When I start the game and I am controlling my sprite up,down,left,right it moves one pixel to a direction, stops for a sec, and then it moves weirdly foward. It almost looks like it is lagging foward. But if i remove the Event I can control the sprite normaly with no issues. But the problem is if I have no event the window gets get fucked up, and I can't max window or move window, and get the message "Program not responding".
I want to control the sprite just as good as I can when I play without events.

Sorry, I know I have explained my problem badly. But it is hard to explain this problem, and my english is bad.
But if anyone understand what I am trying say and knows a solution please reply.

Here is my main.cpp if it is of any help to understand. I don't think other code is relevant to this problem.

Main.cpp
#include <SFML/Graphics.hpp>
#include "data.hpp"
#include "controls.hpp"
#include "window.hpp"
#include "menu.hpp"
#include "act.hpp"

int main()
{
        Data.datainit();

        app.window.create(sf::VideoMode(videowidth,videoheight,32),"Game Engine");

        app.window.setFramerateLimit(fps);

    while(app.window.isOpen())
    {
                sf::Event events;

                if(app.window.pollEvent(events))
                {
                        if (events.type == sf::Event::Closed) app.window.close();
                       
                        Act.actinit();
                }
    }
        return 0;
}

5
Graphics / I get some weird error when using View :S
« on: March 22, 2013, 11:30:56 pm »
I get the error "error C2065: 'View' : undeclared identifier" and "error C2228: left of '.Move' must have class/struct/union".
But the thing is when i right click view and click "Go to Defenition" it finds "...SFML\Graphics\View.hpp(43)".


file "camera.hpp"
#ifndef CAMERA_H
#define CAMERA_H
#include "sfml.hpp"

class camera
{
        public:

                void view()
                {

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
                                {
                                        View.Move(0, -1);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
                                {
                                        View.Move(1, 0);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                                {
                                        View.Move(-1, 0);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                                {
                                        View.Move(0, 1);
                                }
                }

                void zoom()
                {
                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Add))
                                {
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Dash))
                                {
                                }
                }

}camera;
#endif
 

6
Graphics / Re: SFML 2.0 Font glitch
« on: January 23, 2013, 09:26:16 pm »
Thank you!   ;D

7
Graphics / SFML 2.0 Font glitch
« on: January 23, 2013, 07:19:08 pm »
What is wrong with my codes?
When one of the score counters is smaller than the other one, one of them will look normal. But if both of them have the same size both will look like white blocks :/


        //score text
        sf::Font font;
        font.loadFromFile("Squareo.ttf");
        font.loadFromFile("Squareo.ttf");
    sf::Text score1("0", font, 80);
        score1.setPosition(RENDERWIDTH / 4, 0);
        sf::Text score2("0", font, 80);
        score2.setPosition(3 * RENDERWIDTH / 4 - score2.getLocalBounds().width, 0);
 


        //score text
        sf::Font font;
        font.loadFromFile("Squareo.ttf");
        font.loadFromFile("Squareo.ttf");
    sf::Text score1("0", font, 79);
        score1.setPosition(RENDERWIDTH / 4, 0);
        sf::Text score2("0", font, 80);
        score2.setPosition(3 * RENDERWIDTH / 4 - score2.getLocalBounds().width, 0);
 

8
General / Re: Cannot find -lsfml-*
« on: July 24, 2012, 08:07:39 pm »
btw.. i can't find any OpenGL header.
Do i have to download it from some website?

9
General / Re: Cannot find -lsfml-*
« on: July 24, 2012, 08:01:22 pm »
I know that i don't have to include that many headers for that program only. But the thing is that me and my cousin wants to make an rpg game.
so that is why have those included. this is the first time we are making a game, so we don't know very mutch about how it works.

10
General / Re: Cannot find -lsfml-*
« on: July 24, 2012, 07:50:54 pm »
If somebody have the time to help me, you can go to my stream http://en.twitch.tv/tajitakeo and chat with me live. Please help me. i need it bad :(

11
General / Re: Cannot find -lsfml-*
« on: July 24, 2012, 07:36:44 pm »
Ok! i removed that link.
But now i get several errors that you can see in the attachment.

[attachment deleted by admin]

12
General / Cannot find -lsfml-*
« on: July 24, 2012, 05:40:17 pm »
Hello! :)
I am using Code Blocks and sfml 1.6 on a windows 7 - 64 bit computer.
When i try to build this program (http://www.sfml-dev.org/tutorials/1.6/window-opengl.php) i get an error.

first i get "cannot find -lsfml-config-d"
and if i remove that link i get another link as an error.
i have tried to fix this problem for hours now and i am so pissed of now that i can't think :(
Please help me to fix this problem.

Pages: [1]