: I am really new to programming, and would really appreciate if
: someone would take a look at the entire tutorial at
: http://triplebuffer.devmaster.net/file.php?id=3&pa%20ge=0
:
: And explain the last part of page 4 to me. It says:
:
: "And that's it! You've got the code, now you just need the graphics.
: To make the graphics, create a new bitmap of a size TILESIZE*9
: width, and TILESIZE*2 height. Now, divide this into 16x16 squares,
: or whatever TILESIZE you have, and you'll have two rows of 9
: columns. Make the bottom row totally black (0 r,0 g,0 b). Make each
: column of the top row a different color. In order, make the columns
: Black, Grey, Blue, Red, Green, Yellow, White, Steel, and Purple.
: Black and Grey should be totally 1 color, with maybe a little
: shading for a better look."
:
: I do not know how create a bitmap, and also I do not where to
: implement it.
: I know I sound really stupid but i just got into this (i have basic
: level C knowledge), but I want to make this Tetris thing work.
: Please Help!
:
lol--I seen that tutorials first post on gamedev.net!
Anywho...
To create a bitmap, just open up paint and draw the tiles in it.
Then save it as a 24bit bitmap file.
His tutorial has a bitmap you can use. In the 4th tutorial,
on the bottom of the page (displayed "Example bitmap"). Just
copy that and save the bitmap.
Following his tutorial, GameInit() loads the file (Displyed in
red):
bool GameInit()
{
//set the client area size
RECT rcTemp;
//160x480 client area
SetRect(&rcTemp,
0,0,
MAPWIDTH*TILESIZE+TILESIZE*GREY,
MAPHEIGHT*TILESIZE);
//adjust the window size based on desired client area
AdjustWindowRect(
&rcTemp,
WS_BORDER | WS_SYSMENU | WS_CAPTION| WS_VISIBLE,FALSE);
//set the window width and height
SetWindowPos(hWndMain,
NULL,
0,0,
rcTemp.right-rcTemp.left,
rcTemp.bottom-rcTemp.top,
SWP_NOMOVE);
//create map image
HDC hdc=GetDC(hWndMain);
bmoMap.Create(hdc,MAPWIDTH*TILESIZE+TILESIZE*GREY,MAPHEIGHT*TILESIZE);
FillRect(bmoMap,&rcTemp,(HBRUSH)GetStockObject(BLACK_BRUSH));
ReleaseDC(hWndMain,hdc);
bmoBlocks.Load(NULL,"blocks.bmp");
NewGame();
return(true);//return success
}
It will load whatever filename you give it and treat it as the tileset.
[.:EvolutionEngine][.:MicroOS Operating System][Website]