Help in game making

Please help me in a game in which i have to make a puzzle game of a picture i add and then break it in different pieces and then the user has to arrange them back and make the original picture
Which tool i should use and plese tell me where to download it
or give me a good suggestion at least!!
Please help me in this problem cause its really urgent

Replies

  • Ashutosh_shukla
    Ashutosh_shukla
    Sorry but i joined late so reply comes in late.
    The problem you are talking about is similar to puzzle that comes of nos 1 to 15 and an extra blank is there and you have to arrange it.I am giving you my code it works for that puzzle of nos.
    Your task is to manage images instead of numbers
    #include
    #include
    #include
    #include"dos.h"
    int getkey()
    {
    	union REGS i,o;
    	while(!kbhit());
    	i.h.ah=0;
    	int86(22,&i,&o);
    	return(o.h.ah);
    }
    void display();
    int a[4][4]={1,4,15,7,8,10,2,11,14,3,6,13,12,9,5,0},bl=15,flag=1;
    void main()
    {
    	int t,i,j;
    	clrscr();
    	display();
    	while(flag)
    	{
    		t=getkey();
    		if(t==75)
    			if(bl%4 != 0)
    			{
    				for(i=0;i<4;i++)
    				{
    					for(j=0;j<4;j++)
    						if(4*i+j == bl)
    						{
    							a[i][j]=a[i][j-1];
    							bl--;
    							break;
    						}
    					if(j<4)
    						break;
    				}
    				clrscr();
    				display();
    			}
    		if(t==77)
    			if(bl%4 != 3)
    			{
    				for(i=0;i<4;i++)
    				{
    					for(j=0;j<4;j++)
    						if(4*i+j == bl)
    						{
    							a[i][j]=a[i][j+1];
    							bl++;
    							break;
    						}
    					if(j<4)
    						break;
    				}
    				clrscr();
    				display();
    			}
    		if(t==72)
    			if(bl>3)
    			{
    				for(i=0;i<4;i++)
    					for(j=0;j<4;j++)
    						if(4*i+j+4 == bl)
    						{
    							a[i+1][j]=a[i][j];
    							a[i][j]=0;
    							bl=4*i+j;
    							break;
    						}
    				clrscr();
    				display();
    			}
    		if(t==80)
    			if(bl<=11)
    			{
    				for(i=1;i<4;i++)
    				{
    					for(j=0;j<4;j++)
    						if((4*i+j-4) == bl)
    						{
    							a[i-1][j]=a[i][j];
    							a[i][j]=0;
    							bl=4*i+j;
    							break;
    						}
    					if(j<4)
    						break;
    				}
    				clrscr();
    				display();
    			}
    		flag=0;
    		for(i=0;i<4;i++)
    		{
    			for(j=0;j<4;j++)
    				if(a[i][j] != 4*i+j+1)
    				{
    					flag=1;
    					break;
    				}
    			if(j<4)
    				break;
    		}
    	}
    	getch();
    }
    void display()
    {
    	int i,j;
    	for(i=0;i<4;i++)
    	{
    		for(j=0;j<4;j++)
    			if(4*i+j == bl)
    				printf("    ");
    			else
    				printf("%4d",a[i][j]);
    		printf("\n");
    	}
    }
    
    this code is compiled on turbo c
    i made it some 4 months ago
    don't ask how i did it
    i don't remember it now either.
    😎

You are reading an archived discussion.

Related Posts

What are the ideas for a person to work from home ? How does it work ? and how safe is it ? What is the risk involved in it...
MS Excel...... I love it ! One of the most interesting and useful software by Microsoft that I encountered! I found it so coooool and useful, I love using it...
I have been curious about this question for the past few days! Thought, may be I can get some answers here !!! How telepathy works ??? 😛 --Differential
i like to do my project in power system, plz suggest me some inovative topics......................
Admin Note: . For advertising on CE Forums, please write to admin at crazyengineers dot com