It's been several years since I've made a tile-based game, so bear with me. These are the highlights that I remember.
Tile maps:
The key thing to realize is that tile maps can have multiple "layers".
Primary layer: where your character runs around.
Foreground layers: objects 'in front' of your character, usually scrolls faster than primary layer
Background layers: objects 'behind' your character (IE scenery), usually scrolls slower than primary layer
Collision layer: non-visible areas where the character will 'collide' with the world. May define several types of collision, such as slopes or different terrain (ice)
Trigger layer: Areas that cause an event when something enters them (player, enemy, etc)
Refer to TehOwn's post for more information about tile collision.
Mouse Input & bullet firing:
You really want your input to be hardware accelerated, but to get things going quickly you can use the windows function GetCursorPos(LPPOINT).
This returns a point in screen space, you need to convert it to client space.
PSEUDOCODE
void Player::UpdateGun()
{
// This buffers the input, so we aren't shooting a bullet
// every frame the left mouse button is held
static bool bMouseWasClicked = false;
// Check if the left mouse button is pressed
if( GetAsyncKeyState( VK_LBUTTON ) && !bMouseWasClicked )
{
POINT mousePos;
float bulletDirX, bulletDirY;
bMouseWasClicked = true;
// Get current position of mouse
GetCursorPos( &mousePos );
ScreenToClient( hWindow, &mousePos );
// Get a vector from the gun to the mouse
bulletDir.x = mousePos.x - m_Gun.x;
bulletDir.y = mousePos.y - m_Gun.y;
// Normalize the direction vector
float mag= sqrt( bulletDirX * bulletDirX + bulletDirY * bulletDirY );
if( mag == 0.0f ) mag = 1.0f;
bulletDirX /= mag;
bulletDirY /= mag;
// Tell the gun which way to fire
m_Gun.Fire( bulletDirX, bulletDirY );
}
else
{
bMouseWasClicked = false;
}
}
This is completely untested code, but that's the general idea.