BadWolf posted on Sep 25 2006 at 04:45 PM said:
do you mean just rotating the animation 90 degrees?Pickle posted on Sep 26 2006 at 05:33 PM said:Pink background is good, its what im using. png are good too. If the frames are placed with the animation going left to right, that will make life easier.
There are 2 ways I can see doing the waves, either place them in the ascii map or randomly animate them anywhere in the water. THe second I think would be better, just will take more time.
BadWolf posted on Sep 26 2006 at 05:02 PM said:do you mean just rotating the animation 90 degrees?Pickle posted on Sep 26 2006 at 05:33 PM said:Pink background is good, its what im using. png are good too. If the frames are placed with the animation going left to right, that will make life easier.
There are 2 ways I can see doing the waves, either place them in the ascii map or randomly animate them anywhere in the water. THe second I think would be better, just will take more time.
I think that if they are going to go anywhere in the water they would need to be a different animation and just be kind of like a swell.
BadWolf posted on Sep 27 2006 at 10:53 PM said:LIke so? there are 8 frames in there btw.
how about where the swells should be are calculated during a loading time for a set distance from the ship depending where the land is and have it calculate a little more when it passes half of that pre calculated distence...................or something. that way there is the posibility for randumly generated maps in the future.
BadWolf posted on Sep 28 2006 at 05:46 PM said:ill help as much as I can but during the school week and sometimes on the weekends i dont have much time :/
Pickle posted on Sep 29 2006 at 08:31 AM said:BadWolf posted on Sep 28 2006 at 05:46 PM said:ill help as much as I can but during the school week and sometimes on the weekends i dont have much time :/
Understandable, it will be the same with me at some point.
// look up bit shifts on google!
// setting a higher value for SHIFT, like 8, would produce even more precise results
#define SHIFT 5;
long int ship_x = 0;
long int ship_y = 0;
int x, y;
int cosTable[360];
int sinTable[360];
// angle set at 45 is just an example...
int angle = 45;
--
for(int x = 0; x < 360; x++) {
// multiplying the small float from the trig function by 32, then converting the result to int helps maintain precisity
cosTable[x] = (int)(cos(x) * (2 ^ SHIFT));
sinTable[x] = (int)(sin(x) * (2 ^ SHIFT));
}
--
ship_x += cosTable[angle];
ship_y -= sinTable[angle];
--
// drawing function, use these values for x and y coordinates:
// this is like doing ship_x / 32 (or ship_x / 2^5), only much faster because it's not floating point!
x = ship_x >> SHIFT;
y = ship_y >> SHIFT;
BlitFunction(x, y, shipgraphic, etc.);
Alex. posted on Oct 4 2006 at 01:59 PM said:Here's a faster way to work with angles, I hope it helps
- Alex
//Create Angle Tables
float pi = (float)atan(1)*4;
for(int a = 0; a < 360; a++)
{
sprite_angle[a][0] = (int)(sin(a*pi/180) * 32767); //X
sprite_angle[a][1] = -(int)(cos(a*pi/180) * 32767); //Y
}
XPosScaled = 0;
YPosScaled = 0;
void CSpriteDynamic::MoveByAngle( std::vector<CSpriteStatic>* tiles )
{
AddAnglePos( AngleVel );
AddYPosAccurate( sprite_angle[AnglePos][1] );
collsionbox.y = YPos; //Offset the Sprite Collision box
if( tiles != NULL) DetectCollisions( YAXIS, tiles );
AddXPosAccurate( sprite_angle[AnglePos][0] );
collsionbox.x = XPos; //Offset the Sprite Collision box
if( tiles != NULL) DetectCollisions( XAXIS, tiles );
}
void CSpriteDynamic::AddXPosAccurate( int posxscaled )
{
if( posxscaled > 0 ) //Positive
{
if( posxscaled > 65535 - XPosScaled )
{
SetXPos( GetXPos() + 1 );
XPosScaled = posxscaled - (65535 - XPosScaled);
}
else
{
XPosScaled += posxscaled;
}
}
else if( posxscaled < 0 ) //Negative
{
if( -posxscaled > XPosScaled )
{
SetXPos( GetXPos() - 1 );
XPosScaled = 65535 - (-posxscaled - XPosScaled);
}
else
{
XPosScaled += posxscaled;
}
}
}
BadWolf posted on Oct 8 2006 at 05:47 AM said:Im sorry that i havent had much time but here is a grass tile that dosent look like its a tile
http://www.silvir.com/tile.php?src=http://...6/grasstest.png
and in single form
BadWolf posted on Oct 8 2006 at 12:47 AM said:Im sorry that i havent had much time but here is a grass tile that dosent look like its a tile
http://www.silvir.com/tile.php?src=http://...6/grasstest.png
and in single form
BadWolf posted on Oct 9 2006 at 05:04 PM said:i hate the grass in those tiles and the water. the colors are to.....bland?
*stabs clouds*