Game using cursor control

This is a discussion on Game using cursor control within the Game Programming forums, part of the General Programming Boards category; I want to make game using cursor control in C , but I dont have the idea . I have ...

  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
    and the hat of Marriage Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    178
    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,&dwBytesWritten);

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, 08: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, 02:15 PM
  5. cursor control
    By Draco in forum C++ Programming
    Replies: 4
    Last Post: 11-13-2003, 09:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21