• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

mickey

how to you blit bitmap in an array?

4 posts in this topic

i want to blit a bitmap on a 3 by 3 tictactoe grid when the user presses the left mouse button,
0

Share this post


Link to post
Share on other sites
hey da_cobra, haha found me here eh!

Anway, sorry about that, what I want to do is, there's a picture of a 3 by 3 tic tac toe grid on the screen ie.,

____|_____|____
____|_____|____
| |

then, using the left mouse button, the user will select any area on this 3 by 3 grid to put his mark(say X), and the X mark must appear ONLY within the grid's available area. my program must not allow or must not accept if the input will be outside of the grid,

oh and Da_Cobra, i got this snippet from your code,
Blt(&dest, G.lpDDSBuffer, &src, DDBLT_WAIT, NULL) ;

does &dest and &src already contain a bitmap or something here?

I ask here coz am kinda shy asking you guys there in our forum hehe

Edited by - mickey on December 19, 2001 11:38:24 AM

Edited by - mickey on December 19, 2001 11:40:14 AM

Edited by - mickey on December 19, 2001 11:44:09 AM

Edited by - mickey on December 19, 2001 11:45:34 AM
0

Share this post


Link to post
Share on other sites
oh da cobra, forget about my last question that was quite silly,
here,

void BlitArray()
{
for (i=0; i<10; i++)
for (j=0; j<20; j++)
switch (PlayField [j])
{
case 1: // blue cube
{
// make the current copy position for the source cube
SetRect(&src, 0, 0, 16, 16) ; // SetRect( &src, top, left, right, bottom );
// make the current paste position for the destination cube
SetRect(&dest, (PlayfieldX+(16*i)), (PlayfieldY+(16*j)),
(PlayfieldX+(16*i)+16), (PlayfieldY+(16*j)+16)) ;
// now just blit the source cube to the destination cube
G.lpDDSBack->Blt(&dest, G.lpDDSBuffer, &src, DDBLT_WAIT, NULL) ;
break ;
}


are you just coping the area(no content) of &src to &dest here?
0

Share this post


Link to post
Share on other sites
well its actually very easy :D

you have to use the following line to define the what you want to copy from your buffer surface

SetRect(&src, 96, 0, 112, 16) ; // (&src,top-left x&y, bottom-right x&y)

then define where you want to copy it to your back buffer

SetRect(&dest, 96, 0, 112, 16); // (&dest, top-left x&y, bottom-right x&y)

remark => both areas should be the same size else your image will be smaller/bigger (directx would stretch it so it fits into your destination rectangle)


for your blitting I would suggest first to have 9 nrs for your playfield like this :

  

1 | 2 | 3
---------
4 | 5 | 6
---------
7 | 8 | 9

then when you press a number an X or an O appears on that place
if that works then just modify your code so it also works with a mouse (but here I can''t help, I''ve never used a mouse before in my DirectX games)

hope I helped a bit

PS don''t be shy to ask on our forum first :D

0

Share this post


Link to post
Share on other sites