Jump to content
  • Advertisement

Carlos Martinez

Member
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

141 Neutral

About Carlos Martinez

  • Rank
    Member
  1. Carlos Martinez

    SFML - Acceleration in Space?

      I think that doesn't change anything on the behavior...     I think it does: I am treating the speed as a vector, while your "acceleration" (actually speed, I think) is a scalar.     You were right, my fault. Thanks!
  2. Carlos Martinez

    SFML - Acceleration in Space?

      I think that doesn't change anything on the behavior...
  3. Carlos Martinez

    SFML - Acceleration in Space?

      Lol, that was my error traducing the code to English
  4. Carlos Martinez

    SFML - Acceleration in Space?

    Yeap, me again, lol. The thing is, I'm trying to give my ship an acceleration as if it were moving in space (zero gravity), if a press the Up arrow key, the ship increases its acceleration, change its direction (to the mouse vector), and so forth. There's the code I already have: sf::Vector2f Nave::getDirection(sf::Vector2f mousePOS, sf::Vector2f playerPOS, float acceleration, sf::Time& delta) { sf::Vector2f direction = mousePOS - playerPOS; direction = direction / sqrt(direction .x * direction .x + direction .y * direction .y) * aceleration; return direcion; } void Nave::update(sf::Time& delta, sf::Vector2f mousePOS) { ... if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) { acceleration += 0.1f; shipDir = getDirection( mousePOS, shipSprite.getPosition(), aceleration, delta ); } if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) { acceleration -= 0.1f; } if( acceleration > 5.0f ) acceleration = 5.0f; else if( acceleration < 0.0f ) acceleration = 0.0f; shipSprite.move( shipDir.x, shipDir.y ); shipSprite.setAngle(angle); ... } float Nave::Angle( sf::Vector2f playerPOS, sf::Vector2f mousePOS ) { float angle = atan2(mousePOS.y - playerPOS.y, mousePOS.x - playerPOS.x ); angle = angle * (180/PI); if(angle < 0) { angle = 360 - (-angle); } return angle; } Of course there's an obvious problem, first, the deceleration, but most important, when I press the Up arrow again, the new vector direction totally f**ks the last direction, there's a video showing the problem:     Since I didn't find solution just looking at google (my poor English makes it harder, I think there aren't too much good gaming forums on Spanish), I'm looking for some help (duh).   Edit1:   there's a really explicit example of what i'm looking for:  
  5. Carlos Martinez

    SFML - Is there a way to implement lights?

      Begginer question here, does gimp have a way to paint all the silhouette white?   Edit: Solved, but i think my gimp have a bug, when i apply the DoG all the layer gets transparent, what the..
  6. Carlos Martinez

    SFML - Is there a way to implement lights?

      Hmm, that sounds simpler, the problem is that every bullet is a mini-circle, it has the same color all over it, I try it, but I can't see any difference, lol
  7. Carlos Martinez

    SFML - Is there a way to implement lights?

      Great work with that, thanks!
  8. Well, this is what I have done:     It's nothing amazing, but ignoring it, I was looking for a way to implement a small light on every bullet, first because the bullets can't be seen very well, but I don't want to use sprites for these... Is there a way to do that? I've been trying the sf::BlendMode::Add, but idk how does that exactly work .
  9. Carlos Martinez

    Help with a 2D Space Shooter!

      I solved it with a little difference, just one question, there you use a normalize function (.normalize()), Is that function on the sfml's headers? 
  10. Carlos Martinez

    Help with a 2D Space Shooter!

      I have not started It yet, I just want a simple idea, just for know where to start.
  11. Carlos Martinez

    Help with a 2D Space Shooter!

    I'm wanting to start a little project (I'm a beginner), about a Space Shooter, but, I need help with a few things...    The first thing is implementing the shooting, I mean, the bullets will go at the mouse direction, how can I implement the angles of shooting? The second is, how to implement a simply mini-map? Just showing where my ship is, some bases, etc...   Lol, I wish I could explain a lot better but, English isn't my first language :(, anyway, any help, link, tutorial, will be appreciated!   I'm using SFML and C++ btw.
  12. Carlos Martinez

    Where should I start?

      What do you think are the most important topics about C++? I'm very familiarized with the basics, I mean, variables, functions, classes, objects, inheritance, etc.. Where should I go further in C++?   Thank you very much for all your answers. 
  13. Carlos Martinez

    Where should I start?

      You're right about everything you said, and I'm definitely going to learn C++, otherwise, will be helpful start on 2D graphics instead jumping to 3D directly?
  14. Carlos Martinez

    Where should I start?

      Lol, thats really nice. Don't you have any nice project you can show us?     Don't you have experience with an engine, anything to recommend?
  15. Carlos Martinez

    Where should I start?

      I've been looking the Irrlicht engine, it seems pretty nice, do you have any tutorials or anything else about this engine?          Well, It seems to be a big decision, I mean, picking a language... C# and XNA only supports Windows and Xbox, I really think C# is a very nice language, straightforward, but I'm not that conviced on It for making games... And Java, well, pretty much the same thing, excepting It's portability. Anyway, I'm looking for opinions!   I'm thinking to start learning C++ more deeper (IDK if deeper is the word I'm looking for, lol), so, can anyone recommend some libraries, or engines to start? I've been looking "SDL", "Irrlicth", and "Allegro"...   Btw, just for curiosity, how old were you when you start programming? I'm 18 years old and I've been programming in C# since I was 16, is it a good age to start C++? 
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!