Hmmmmm...tiles then. I'll look into that. Thanks!
Type: Posts; User: blackCat
Hmmmmm...tiles then. I'll look into that. Thanks!
Im using Visual C++ 2005 to program a 2D spaceship navigating across a scrolling background. The background is a simple picture, which I have copied and pasted a few times to extend it in paint.
...
Cheers guys, I've got something kinda working now with the following...
The only trouble I'm having now is that the angle of the ship does not appear to be updating until I press the thrust key. ...
is dAngle in radians? Yes I'ts converted to radians in the spaceship class.
bvy = -10 * cos(dAngle); I got this from a website, which i was trying out.
I could try stepping through it - I'm...
I'm trying to get bullets to fire from the ship in the direction it is rotated. I've tried using the following, but it keeps firing long, weird lines to the top left corner of the screen. I have to...
Nevermind, I've figured it out...
Swapped this:
//Adjust bearing angle according to the above key press
velocity.setBearing((dAngle/360*6.282), velocity.magnitude());
I'm rotating a sprite using the following, but when the spaceship, which is circular, is facing towards the left side of the screen and I press the thrust key it slows down? Any help? Velocity,...
Thats right. Heres the full function...
I could just make do with three of these functions within the accelerometer driver for all 3 axis and not pass an array. However, I was making a hacking...
X is the reading from an accelerometer's x axis. The new X reading gets fed into the filterReading(...) function and the array of previous readings is used to filter the reading before returning it...
There you go...
/******Header file code********************/
struct accProperties
{
int xAxis;
int yAxis;
int zAxis;
I'm trying to pass the actual array address into the filterReading(...) function so it can be modified and returned. The parts highlighted in bold below are the relevant parts. Any help please? Oh...
Ha ha thats quality that guys. Thanks.
P.s. now I feel guilty for not doing it myself.
When moving a chopper picture around the screen using 3 different chopper pictures, how does one increase the animation speed as the chopper speed increases in velocity?
The drawHelicopter...
Thanks!
I'm trying to generate random numbers between -10 and +10. Any help...below is what I've tried:
srand(time(NULL));
for (int i=0;i<10;i++)
cout << ((rand() % -10) + -10 + 10) << endl;
Thanks!!
accelProps.xAxis is a 32 bit integer reading from an accelerometer...
Int16U xVal = accelProps.xAxis;
Will the above copy the first 16 bits of the 32 bit integer into the 16 bit integer?