Switch to full style
Igranje pod Linuxom.
Odgovori

Re: Napravio sam igru, za sad

30 ožu 2014, 12:40

gagiD je napisao/la:
paupav je napisao/la:si ispakirao sve u jednu mapu?


http://zaslike.com/files/iovvustgaol045gnu.png :zvizdi


:thmb-up

Re: Napravio sam igru, za sad

30 ožu 2014, 12:43

probajte ovo
Privitak/ci
paupav game.tar.bz2
(216.56 KiB) Preuzeto 81 put/a.

Re: Napravio sam igru, za sad

30 ožu 2014, 12:46

Vec sam pokusavao dodat .cpp datoteku, al forum ne podrzava; evo vam onda ovdje source
Kod:
#include <iostream>
#include <SFML/Graphics.hpp>
#include <unistd.h>

int main()
{
    sf::ContextSettings settings;
    settings.antialiasingLevel = 16;
    sf::RenderWindow window(sf::VideoMode(800, 600), "DogePav", sf::Style::Default, settings);
    sf::Clock clock;
    sf::Clock clock2;
    sf::Clock clock3;
    sf::Vector2i tripos(90, 310);
    sf::Vector2i octpos(400, 400);
    sf::Vector2i sqpos(650, 299);
    sf::Vector2i collected(760, 20);
    bool returning = false;
    bool userControls = true;
    float positionx = 10;
    float positiony = 16;
        sf::CircleShape triangle(20, 3);
        sf::CircleShape square(20, 4);
        sf::CircleShape octagon(20, 8);
        sf::CircleShape shape(30, 999);
        sf::Texture texture, texture2;

        if(!texture.loadFromFile("texture.png"))
        {
            std::cout << "Could not load ball texture" << std::endl;
        }
        shape.setTexture(&texture);
        //floor
        sf::RectangleShape floor(sf::Vector2f(800, 60));

        if(!texture2.loadFromFile("brick.png"))
        {
            std::cout << "Could not load floor texture" << std::endl;
        }
        floor.setTexture(&texture2);
        floor.setPosition(0, 540);

        octagon.setFillColor(sf::Color::Blue);
        triangle.setFillColor(sf::Color::Yellow);
        square.setFillColor(sf::Color::Magenta);

    while(window.isOpen())
    {
        triangle.setPosition(tripos.x, tripos.y);
        octagon.setPosition(octpos.x,octpos.y);
        square.setPosition(sqpos.x,sqpos.y);
        sf::Time borderBounce = clock3.getElapsedTime();

        sf::Time time = clock.getElapsedTime();
        sf::Time physic = clock2.getElapsedTime();
        shape.setPosition(positionx, positiony);
        if(!returning)
        positiony = time.asMicroseconds() / 2319 + physic.asMilliseconds()/ 22;

        while(positionx < 2)
            positionx++;
        while(positionx > 650)
            positionx--;



       if(positiony > 480)
            returning = true;

        if(returning )
        {
            positiony -=8;
            clock.restart();
        }
        if(positiony < 15 + physic.asMilliseconds()/ 22)
        returning = false;


        if(physic.asSeconds() > 13)
        {
            clock.restart();
            clock2.restart();
            tripos.x = 90;
            tripos.y = 310;
            octpos.x = octpos.y = 400;
            sqpos.x = 650;
            sqpos.y = 299;
        }

        sf::Event event;
        while(window.pollEvent(event))
        {

            switch(event.type)
            {
                case sf::Event::Closed:
                window.close();
            }
        //collect triangle

        std::cout << "Triangle pos: " << positionx << " " << positiony <<std::endl;
        }

        if( 120 > positionx &&  60 < positionx && positiony > 280 && positiony < 340)
        {
            tripos.x = collected.x;
            tripos.y = collected.y;
        }
        //collect oct
        if( 430 > positionx &&  370 < positionx && positiony > 370 && positiony < 430)
        {
            octpos.x = collected.x;
            octpos.y = collected.y * 6 - 20;
        }
        //collect square
        if( 680 > positionx &&  620 < positionx && positiony > 269 && positiony < 329)
        {
            sqpos.x = collected.x;
            sqpos.y = collected.y * 3;
        }
        if(userControls)
        {
            if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                positionx += 5;
            if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                positionx -= 5;
            std::cout.flush();

        }

    window.clear(sf::Color::White);
    window.draw(shape);
    window.draw(floor);
    window.draw(octagon);
    window.draw(triangle);
    window.draw(square);
    window.display();
    window.setFramerateLimit(60);

    }
}

Re: Napravio sam igru, za sad

30 ožu 2014, 12:47

Ispakirala* oprostite :)

Re: Napravio sam igru, za sad

30 ožu 2014, 12:57

Kod:
bash: ./DogePav: cannot execute binary file



Kod:
falcon@archlinux:~/documents$ g++ -o doge doge.cpp
doge.cpp:2:29: fatal error: SFML/Graphics.hpp: No such file or directory
 #include <SFML/Graphics.hpp>
                             ^
compilation terminated.
falcon@archlinux:~/documents$


:hmm

Re: Napravio sam igru, za sad

30 ožu 2014, 13:09

Source si mogao zipat i poslat na forum.. :zvizdi
BTW, ni ova druga ne radi. Veli Exec format error.

Re: Napravio sam igru, za sad

30 ožu 2014, 13:23

Igrica je svejedno bez veze :) . Svejedno ću pokušati; instalirat ću 32-bitni Antergos :)

Re: Napravio sam igru, za sad

30 ožu 2014, 14:06

Ev ja sebi iskompajlirah :D

Here!

Mozemo ocekivat 0.2 ?

Re: Napravio sam igru, za sad

30 ožu 2014, 16:45

Mozete sad nac 32 bitnu i 64bitnu verziju u originalnom postu. I da, bit ce verzija 0.2 :D

Re: Napravio sam igru, za sad

30 ožu 2014, 18:24

moze li tko probat samo da vidim dal radi?
Zadnja izmjena: paupav; 30 ožu 2014, 19:08; ukupno mijenjano 1 put/a.
Odgovori