gagiD je napisao/la:paupav je napisao/la:si ispakirao sve u jednu mapu?
http://zaslike.com/files/iovvustgaol045gnu.png
Sada je: 19 tra 2024, 04:41.
Moderator/ica: Moderatori/ce
28 post(ov)a
•
Stranica: 2/3. • 1, 2, 3
probajte ovo
Privitak/ci
- paupav game.tar.bz2
- (216.56 KiB) Preuzeto 199 put/a.
Vec sam pokusavao dodat .cpp datoteku, al forum ne podrzava; evo vam onda ovdje source
- Kod: Označi sve
#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);
}
}
Ispakirala* oprostite
- Kod: Označi sve
bash: ./DogePav: cannot execute binary file
- Kod: Označi sve
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$
Source si mogao zipat i poslat na forum..
BTW, ni ova druga ne radi. Veli Exec format error.
BTW, ni ova druga ne radi. Veli Exec format error.
Arch Linux Install Script (BIG update, BETA verzija)
I've seen some idiots back in my time, but you man... you're special!
Vl@do je napisao/la:Arch imaš upravo zato da uštediš na vremenu. Nemaš nikakvih problema s instalacijama, kompajliranjem i ostalim. Imaš jednostavno funkcionalan i stabilan, uvijek najsvježiji OS, a osim toga je sexy i cool do neba.
I've seen some idiots back in my time, but you man... you're special!
Igrica je svejedno bez veze . Svejedno ću pokušati; instalirat ću 32-bitni Antergos
Mozete sad nac 32 bitnu i 64bitnu verziju u originalnom postu. I da, bit ce verzija 0.2
moze li tko probat samo da vidim dal radi?
Zadnja izmjena: paupav; 30 ožu 2014, 19:08; ukupno mijenjano 1 put/a.
28 post(ov)a
•
Stranica: 2/3. • 1, 2, 3
Na mreži
Trenutno korisnika/ca: / i 23 gostiju.