How to make a Typing Tutor game?

This is a discussion on How to make a Typing Tutor game? within the C Programming forums, part of the General Programming Boards category; I'm having a hard time making one. I'm just a noobie and I really need help. I have no idea ...

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    How to make a Typing Tutor game?

    I'm having a hard time making one. I'm just a noobie and I really need help. I have no idea what functions to make, and what libraries to include.

    To specify it further, firstly, I need to know how to make a letter fall in the screen.
    Like the conventional typing game, I need to type correctly what's falling in the screen. Do I need to use Gotoxy?

    Thanks for the help!

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> I'm having a hard time making one.

    Understandable. But have you made an effort? What code have you got so far?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Webhead Spidey's Avatar
    Join Date
    Jul 2009
    Posts
    285
    I'm having a hard time making one. I'm just a noobie and I really need help. I have no idea what functions to make, and what libraries to include.
    There are a number of ways you could solve this problem. The best way to get a start is to think about it for a while. Write some pseudo-code and think about the best approach to tackle the problem.
    What features do you want the game to have ? start with the ones you are confident about. Write some code, ask for help when you get stuck.

    To specify it further, firstly, I need to know how to make a letter fall in the screen.
    Like the conventional typing game, I need to type correctly what's falling in the screen. Do I need to use Gotoxy?
    Again, there are a number of ways you could solve this. It will most definitely be more trickier using just the simple console window but it can easily be done. If you think you need to use gotoxy, try it out and see how far you get. Once you start typing it out, you'll soon realize that it wasn't as hard as you thought it would be.

  4. #4
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    Smile

    to be honest, I don't have a single code. Just give me some ideas and the rest is all mine.

  5. #5
    Webhead Spidey's Avatar
    Join Date
    Jul 2009
    Posts
    285
    to be honest, I don't have a single code. Just give me some ideas and the rest is all mine.
    Like I said, start with what you know and write some code. The ideas will come to you automatically.

  6. #6
    Registered User
    Join Date
    Jul 2009
    Posts
    4
    Code:
    #include <stdio.h>
    #include <conio.h>
    #include <mp.h>
    int main()
    {    
      
      gotoxy(40,0);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,1);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,2);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,3);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,4);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,5);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,6);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,7);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,8);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,9);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,10);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,11);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,12);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,13);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,14);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,15);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,16);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,17);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,18);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,19);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,20);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,21);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,22);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,23);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,24);
      printf("A");
      delay(500);
      clrscr();
      gotoxy(40,25);
      printf("A");
      delay(500);
      getch();
    }
    So I've made this code for a letter falling down. But my problem is how can I make this code shorter and instead of falling down to the same line, making a sort of a random fall?
    Btw, mp.h is a self defined library.

  7. #7
    Webhead Spidey's Avatar
    Join Date
    Jul 2009
    Posts
    285
    Wow, thats a long fall!

    It would much be better if you would use loops instead of doing it manually -
    for example, here is some pseudo code -

    Code:
    int x = 40;
    int y = 0;
    char letter = 'A';
    
    while(still on screen)
    {
      clear screen;
      goto x,y;
      increment y;
      print letter;
      delay;
    }

  8. #8
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,541
    Looks a lot like this 'game' as well.
    need help in game in C
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  9. #9
    Registered User
    Join Date
    Jul 2009
    Posts
    4
    Code:
    #include <stdio.h>
    #include <conio.h>
    #include <mp.h>
    int main()
    {       
      
      int x = pickRandom(0,79);
      int y = 0;
    
    
    
      do
      {
          gotoxy(x,y++);
          printf("A");
          delay(100);
          clrscr();
      } 
      
      while(y <= 24);
      
      
      
    
      getch();
    }
    I've already worked it out. Next problem now is after the letter reaches the bottom of the screen how will I be able to start the loop all over again?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 09:10 AM
  2. How to make a Packet sniffer/filter?
    By shown in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2009, 08:51 PM
  3. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  4. make all rule
    By duffy in forum C Programming
    Replies: 9
    Last Post: 09-11-2003, 01:05 PM
  5. Question about atheists
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM

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