1
انجمن تازهکاران / پاسخ : اتصال vpn .
« آخرین ارسال توسط 🇬🇧بریتانیای کبیر🇬🇧 دیروز ساعت 11:41 بظ »و البته دوست عزیز با برداشته شدن بیشتر محدودیت ها حالا سایفون به راحتی وصل میشود.
الان نسخه پایدار دبیان ۱۳ در دسترس هست برای ارتقاع؟
لطفا به دبیان ۱۳ به روز رسانی کنید تا از نسخه های جدید استفاده کنید مشکل برطرف میشهالان نسخه پایدار دبیان ۱۳ در دسترس هست برای ارتقاع؟
سلام
من تور رو نصب داشتم.کنجکاو شدم کاربراتور رو نصب کردم نسخه 4.0 برام نصب شد.
پل هارو ذخیره نمیکنه و با گزینه های دیگه هم وصل نمیشه.
راه حل داره؟
توضیع دبیان پایدار ۱۲
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <random>
using namespace sf;
class Astroids
{
public:
CircleShape shape;
Vector2f velocity;
Astroids(Vector2f postion, float speed)
{
shape.setRadius(25.f);
shape.setOrigin(25.f, 25.f);
shape.setFillColor(Color(150, 150, 150));
shape.setPosition(postion);
float angle = static_cast<float>(rand() % 360) * 3.14159f / 180.f;
velocity = Vector2f(std::cos(angle) * speed, std::sin(angle) * speed);
};
void move() { shape.move(velocity); }
FloatRect getBunds() const { return shape.getGlobalBounds(); }
Vector2f getPosition() const { return shape.getPosition(); }
void wrap(const RenderWindow& win)
{
Vector2f pos = shape.getPosition();
Vector2u size = win.getSize();
float w = static_cast<float>(size.x);
float h = static_cast<float>(size.y);
if (pos.x < 0)
pos.x += w;
if (pos.x > w)
pos.x -= w;
if (pos.y < 0)
pos.y += h;
if (pos.y > h)
pos.y -= h;
shape.setPosition(pos);
}
};
struct Bullet
{
CircleShape shape;
Vector2f velocity;
};
class Soundmanager
{
protected:
SoundBuffer shootBuffer;
Sound shootSound;
public:
void Shootsound(const std::string& full_path)
{
if (!shootBuffer.loadFromFile(full_path))
{
std::cerr << "no such file!" << std::endl;
std::exit(-1);
}
shootSound.setBuffer(shootBuffer);
}
void Play() { shootSound.play(); }
};
class astroid
{
protected:
Vector2f pos;
VideoMode desktop;
FloatRect bunds;
public:
astroid(VideoMode desk) : desktop{desk} {};
virtual void Input(ConvexShape* shape, RenderWindow* win, int& playing);
RenderWindow* init_window();
ConvexShape* player_ship(const RenderWindow& win);
};
ConvexShape* astroid::player_ship(const RenderWindow& win)
{
Vector2u size = win.getSize();
float x = static_cast<float>(size.x) / 2.f;
float y = static_cast<float>(size.y) / 2.f;
ConvexShape* ship = new ConvexShape;
ship->setPointCount(3);
ship->setPoint(0, {0.f, -7.f});
ship->setPoint(1, {-2.5f, 4.f});
ship->setPoint(2, {2.5f, 4.f});
ship->setFillColor(Color::Transparent);
ship->setOutlineThickness(1.7f);
ship->setOutlineColor(Color::White);
FloatRect local = ship->getLocalBounds();
ship->setOrigin(local.width / 2.f, local.height / 2.f);
ship->setPosition(x, y);
return ship;
}
RenderWindow* astroid::init_window()
{
RenderWindow* window = new RenderWindow;
window->create(desktop, "astroid", Style::Default);
return window;
}
void astroid::Input(ConvexShape* shape, RenderWindow* win, int& playing)
{
Vector2u size = win->getSize();
float winw = static_cast<float>(size.x);
float winh = static_cast<float>(size.y);
pos = shape->getPosition();
float speed = 0.4f;
bunds = shape->getGlobalBounds();
if (Keyboard::isKeyPressed(Keyboard::Right) && bunds.left + bunds.width < winw)
shape->move(speed, 0.f);
if (Keyboard::isKeyPressed(Keyboard::Left) && bunds.left > 0)
shape->move(-speed, 0.f);
if (Keyboard::isKeyPressed(Keyboard::Up) && bunds.top > 0)
shape->move(0.f, -speed);
if (Keyboard::isKeyPressed(Keyboard::Down) && bunds.top + bunds.height < winh)
shape->move(0.f, speed);
if (Keyboard::isKeyPressed(Keyboard::Escape))
{
playing = false;
}
}
class rotation : public astroid
{
protected:
std::vector<Bullet> bullets;
Clock fireCooldown;
float firedelay = 0.3f;
Soundmanager* sounds;
Clock astroidsclock;
float astroid_dela = 2.f;
public:
std::vector<Astroids>& getAsteroids() { return asteroids; }
std::vector<Astroids> asteroids;
std::vector<Bullet>& getBullets() { return bullets; }
rotation(VideoMode desk, Soundmanager* sm) : astroid(desk), sounds(sm){};
using astroid::astroid;
virtual void Input(ConvexShape* shape, RenderWindow* win, int& playing) override
{
astroid::Input(shape, win, playing);
FloatRect shipBounds = shape->getGlobalBounds();
if (Keyboard::isKeyPressed(Keyboard::Space) && Keyboard::isKeyPressed(Keyboard::Up))
shape->rotate(1.f);
if (Keyboard::isKeyPressed(Keyboard::Space) &&
Keyboard::isKeyPressed(Keyboard::Left))
shape->rotate(-1.f);
if (Keyboard::isKeyPressed(Keyboard::Space) &&
Keyboard::isKeyPressed(Keyboard::Right))
shape->rotate(1.f);
if (Keyboard::isKeyPressed(Keyboard::Space) &&
Keyboard::isKeyPressed(Keyboard::Down))
shape->rotate(-1.f);
if (Keyboard::isKeyPressed(Keyboard::F) &&
fireCooldown.getElapsedTime().asSeconds() > firedelay)
{
if (asteroids.size() < 10 &&
astroidsclock.getElapsedTime().asSeconds() > astroid_dela)
{
Vector2f pos(rand() % win->getSize().x, rand() % win->getSize().y);
asteroids.emplace_back(pos, 0.6f);
astroidsclock.restart();
}
Bullet bullet;
bullet.shape = CircleShape(2.f);
bullet.shape.setOrigin(bullet.shape.getRadius(), bullet.shape.getRadius());
bullet.shape.setFillColor(Color::Red);
Transform trans = shape->getTransform();
Vector2f tip = trans.transformPoint(shape->getPoint(0));
bullet.shape.setPosition(tip);
Vector2f dir = trans.transformPoint(shape->getPoint(0)) -
trans.transformPoint(shape->getPoint(1));
float length = std::sqrt(dir.x * dir.x + dir.y * dir.y);
Vector2f norm = dir / length;
bullet.velocity = norm * 1.5f;
bullets.push_back(bullet);
fireCooldown.restart();
if (sounds)
sounds->Play();
}
for (auto& a : asteroids)
{
a.move();
a.wrap(*win);
if (shipBounds.intersects(a.getBunds()))
{
playing = false;
std::cout << "GameOver!" << std::endl;
}
}
for (auto& b : bullets)
{
b.shape.move(b.velocity);
}
for (auto bull = bullets.begin(); bull != bullets.end();)
{
bool hit = false;
for (auto ast = asteroids.begin(); ast != asteroids.end();)
{
if (bull->shape.getGlobalBounds().intersects(ast->getBunds()))
{
ast = asteroids.erase(ast);
hit = true;
break;
}
else
++ast;
}
if (hit)
bull = bullets.erase(bull);
else
++bull;
}
}
};
int main()
{
VideoMode desktop = VideoMode::getDesktopMode();
srand(time(0));
Soundmanager sounds;
sounds.Shootsound("/home/learner/Downloads/Pew_Pew-DKnight556-1379997159.wav");
astroid* world = new rotation(desktop, &sounds);
RenderWindow* window = world->init_window();
ConvexShape* ship = world->player_ship(*window);
int playing = true;
while (window->isOpen() && playing)
{
Event event;
while (window->pollEvent(event))
{
if (event.type == Event::Closed)
window->close();
}
window->clear(Color::Black);
window->draw(*ship);
if (rotation* r = dynamic_cast<rotation*>(world))
{
for (auto& b : r->getBullets())
window->draw(b.shape);
for (auto& a : r->getAsteroids())
window->draw(a.shape);
}
world->Input(ship, window, playing);
window->display();
}
delete window;
delete ship;
delete world;
return 0;
}
دبگه بیشتر از این کشش ندارم g++ main.cpp -o game -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
sudo ntfsfix /dev/sdb1