Tag Info

New answers tagged

1

You're right, it can be done in two ways: -Moving the player -Moving the world This seems like a 50-50 deal. It doesn't matter how you do it, right? I don't agree. I would ALWAYS suggest moving the player. Because if you choose to move the world now, and a few months further on in development, when you have enemies, npc's, and other entities on screen, ...


0

Only change the rotation whenever your distance is above a certain delta. Also center your sprite, right now you're using the top-left corner of the sprite.


1

I would personally use the keyboard class that allows you to query the state of keys instead of waiting for an event. The documentation is here One of the reasons I prefer this method is that you can check the status of the key from almost anywhere in the code, and you don't have to store the state of the keys yourself. f::Keyboard can retrieve the ...


0

Your getters (getCTwoInst, getCOneInst and getOne) return copies so you're calling the animate function on a copy of a copy of your sprite. This modified copy is then left unused. Return references instead: Two& getCTwoInst() {return cTwoInst;}


0

First thing you should do is to refactor your code, to have a clear view about what's being done. So get out of thee loop the values that won't change, and cache any re-used value. Below is some pseudo-code that should get you in the right direction. The principle is : get the aimAngle, the angle between player and target (mouse). Then randomly pick ...



Top 50 recent answers are included