prchakal

Member
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

123 Neutral

About prchakal

  • Rank
    Member
  1. FlyForCoins - New game

    Hi,   We have developed a new game. Can anyone help share it? http://flyforcoins.prsolucoes.com/   Or: https://www.facebook.com/appcenter/flyforcoins?fb_source=search&fbsid=1101&fref=ts   We are working on the new title of FlyForCoins, but 3D. If anyone can create 3D models as freelance, contact me.     Thx.
  2. Hi, On my game i want that my shoot go to correct direction (enemy direction), but it doesnt occur. You can see here: [url]http://www.prsolucoes.com/downloads/solodefender.zip[/url] The code that im using is (on update): void Bullet::update() { updateSpriteDirection(); checkCollision(); updatePosition(); } void Bullet::updateSpriteDirection() { sprite.SetRotation( Functions::angle(sprite.GetPosition().x, sprite.GetPosition().y, targetX, targetY) ); } void Bullet::checkCollision() { if (sprite.GetPosition().x + sprite.GetSize().x < 0) { remove(); } else if (sprite.GetPosition().y + sprite.GetSize().y < 0) { remove(); } else if (sprite.GetPosition().x > Constants::SCREEN_WIDTH) { remove(); } else if (sprite.GetPosition().y > Constants::SCREEN_HEIGHT) { remove(); } } void Bullet::updatePosition() { sprite.SetPosition(sprite.GetPosition().x + speedX, sprite.GetPosition().y + speedY); } void Bullet::updateSpeed() { if (sprite.GetPosition().x < targetX) { speedX = Constants::BULLET_SPEED; } if (sprite.GetPosition().x > targetX) { speedX = (Constants::BULLET_SPEED * -1); } if (sprite.GetPosition().y < targetY) { speedY = Constants::BULLET_SPEED; } if (sprite.GetPosition().y > targetY) { speedY = (Constants::BULLET_SPEED * -1); } } What is wrong? Im using SFML.
  3. I solve the problem not using the function "shared_from_this" on constructor. I use only on initilize method, and now i create and initialize the object like it: boost::shared_ptr<Turret> turret1(new Turret()); turret1->initialize(0); //this is the method the contains "shared_from_this" GameObjects::turrets->push_back(turret1); Thanks. The game is working now, deleting all fom memory.
  4. Hi, I have used the "shared_from_this()" from boost, but i receive an exception: http://www.prsolucoes.com/downloads/error_boost.png When i try: Turret::Turret(float angle) { shared_from_this()->angle = angle; initialize(); } Im calling it from constructor
  5. Hi, I have a vector of bullets: static std::vector<boost::shared_ptr<Bullet>> *bullets; But when i remove a bullet from vector with the code: bullets->erase(std::find(bullets->begin(), bullets->end(), (boost::shared_ptr<Bullet>)this)); I get this error(see the image below): http://www.prsolucoes.com/downloads/error_vector.png What i do wrong?
  6. Hi, Im making a small game and now im refactoring some things on it. I have some questions: 1 - I have a vector that store pointers to all enemies objects. So, if using "boost::shared_ptr" to create the pointers insted of tradicional method, when i remove the pointer from the vector using the "erase" method, the pointer/object will be deleted/destroyed from memory? 2 - To use "boost::shared_ptr" i need add some library on my project, or only the include "#include "boost/shared_ptr.hpp"" is necessary? 3 - I have compiled the boost library using the tool "bootstrap.bat", it generate some ".lib" files for only some packages (like filesystem, datetime, ...), why it? This is because only this packages need include the library (".lib") file in my project, and the other only need the header? 4 - When i compiled the "boost", it generate a directory called "stage" and other "bin", what is the correct directory to take my library files (".lib")? 5 - When i compiled the "boost", what is the correct library name for release, debug, static ? It generate too many files for the same package.
  7. How to remove class/sprite

    Hi, I resolve the problem with: for (long x = 0; x < (long)GameObjects::enemies->size(); ++x) { Enemy *enemy = GameObjects::enemies->at(x); if (enemy == this) { GameObjects::enemies->erase(GameObjects::enemies->begin() + x); } } When i erase an element from vector, it is all removed from the memory?
  8. Hi, On my game i have a vector with all my enemies, and i want that when it collide with some other objects, be removed from vector and destroyed. My vector: static std::vector<Enemy*> *enemies; What i have tested: void Enemy::remove() { //GameObjects::enemies->erase(*this); //delete this; for (std::vector<Enemy*>::iterator it = GameObjects::enemies->begin(); it!=GameObjects::enemies->end(); ++it) { if (((Enemy*)*it) == this) { GameObjects::enemies->erase(it); } } } But allways that i do it, i get a fatal error. Im using SFML library.
  9. Math functions for game

    Hi, Thanks for responses. But i think that can exist some tutorials/documents with all you need about this questions. Like a ALL-IN-ONE about game math.
  10. Math functions for game

    Hi, Anyone know any resource that contains Math functions to game (2D / 3D)?? Like: - Object rotation - Object rotation around other object - Object look(point) to another object - Camera rotation - Moving an object in some directon, like shoots of a shooter game - and more... the commons functions
  11. Round an object around other

    Hi, Im using SFML (http://www.sfml-dev.org/). I have the rotation function, but i need rotate around another object. But i dont how and dont know the logic/math to do it. Anyone have referencesdocs about it?
  12. Round an object around other

    Hi, How i can rotate one object around other? Example: The center object is a planet, and i have 5 objects rounding around the planet. How i can make it?
  13. NEWS!!!! THE VERSION WITH RED5 IS OPENSOURCE NOW TOO. You can get the two version on the same link: http://www.prsolucoes.com/site/artigo/evangel_opensource_game
  14. Hi, I made a flash mmo game engine and published it as open source. You can download here: http://github.com/prsolucoes/Evangel/ And you can see thecompiled version to play, here: http://www.prsolucoes.com/evangel/new/