Thread: Game using cursor control

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    7

    Game using cursor control

    I want to make game using cursor control in C , but I dont have the idea . I have to make some modification in this program to create a game.Please help me. I have created this program that uses cursor control:
    insert
    Code:
    #include<stdio.h>
    #include<conio.h>
    void main(void)
    {
    clrscr();
    char ch1;
    int x=0,y=0;
    ch1=getch();
    while(ch1!=27)
    {
    if(ch1=='l' & y>=0)
    {
    y=y-1;
    gotoxy(x,y);
    
    }
    if(ch1==' ' & y<=25)
    {
    y=y+1;
    gotoxy(x,y);
    
    }
    if(ch1=='.' & x<=80)
    {
    x=x+1;
    gotoxy(x,y);
    
    }
    if(ch1==',' & x>=0)
    {
    x=x-1;
    gotoxy(x,y);
    
    }
    ch1=getch();
    }
    gotoxy(0,0);
    getch();
    }

  2. #2
    Registered User
    Join Date
    Oct 2011
    Posts
    7
    No one is here to help a beginner. Disappointing!

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    What exactly did you expect us to answer? You didn't ask anything.


    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    Code:
    #include <windows.h>
    
    POINT mouse_pos;
    
    GetMousePos(&mouse_pos); 
    /* mouse_pos.x is the x coord and mouse_pos.y is the y */
    ?
    Last edited by Rodaxoleaux; 10-13-2011 at 11:33 AM.
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program to control Cursor movement in C
    By beginner in forum C Programming
    Replies: 2
    Last Post: 06-25-2011, 11:20 AM
  2. Change cursor on single edit control
    By Niara in forum Windows Programming
    Replies: 3
    Last Post: 01-11-2009, 09:52 AM
  3. Maintaing Cursor Control
    By leojose in forum Windows Programming
    Replies: 1
    Last Post: 06-09-2005, 08:43 AM
  4. How do you get rid of the cursor
    By zz3ta in forum C++ Programming
    Replies: 1
    Last Post: 12-09-2003, 03:15 PM
  5. cursor control
    By Draco in forum C++ Programming
    Replies: 4
    Last Post: 11-13-2003, 10:03 PM