Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 5 6 [7]

Author Topic: Winner's small games thread  (Read 6793 times)

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: sand dunes *updated*
« Reply #90 on: January 24, 2010, 08:38:30 pm »

It does work, just really fast.
You just need to think of a creative way to slow it down.
I have no idea how do do frame rate stuff though.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Hippoman

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #91 on: January 24, 2010, 09:05:05 pm »

It does work, just really fast.
You just need to think of a creative way to slow it down.
I have no idea how do do frame rate stuff though.
It doesn't work. It only does things when I move. I have to move in order for it to move. Still.
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

winner

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #92 on: January 24, 2010, 09:22:14 pm »

nodelay(initscr(),1);            // don't wait for user input

this line is what makes it run without waiting for the user to enter things.
the 1 stands for true.
this stuff I borrowed from a moonlander game

   nodelay(initscr(),1);            // don't wait for user input
   noecho();                  // don't show typed characters on the screen

do stuff.

   echo();                  // turn echoing back on before exiting
   endwin();                  // end curses control of the window
« Last Edit: January 24, 2010, 09:24:44 pm by winner »
Logged
The great game of Warlocks!

Hippoman

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #93 on: January 24, 2010, 09:23:21 pm »

nodelay(initscr(),1);            // don't wait for user input

this line is what makes it run without waiting for the user to enter things.
the 1 stands for true.
tried that.
Tried sleep too.
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

winner

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #94 on: January 24, 2010, 09:26:16 pm »

ok here is the program I cribbed it from. You can try taking things away from it until it no longer works.

http://www2.cs.uidaho.edu/~cs120/moonlander/moonlander.html
Logged
The great game of Warlocks!

Hippoman

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #95 on: January 24, 2010, 09:33:11 pm »

Helps alot I think I got it. Lemme test.
Edit:
Nope. But I need to test more. THanks for the link.
« Last Edit: January 24, 2010, 09:36:43 pm by Hippoman »
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

winner

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #96 on: January 31, 2010, 03:46:38 pm »

I did quote it.

I'm going to see if I have a color example ready, and if not,
 I'll make one.
That way I don't feel so bad about working on my game.
sounds good
Logged
The great game of Warlocks!

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: sand dunes *updated*
« Reply #97 on: January 31, 2010, 05:01:49 pm »

Sorry it took so long, I sort of forgot.
There is also support for ASCII characters in there,
 in case you didn't know how.

Code: [Select]
#include <curses.h>

int main(void){
    initscr();
    start_color();
    init_color(COLOR_RED,200,1000,200);//how you make your own colors:
    init_pair(9, COLOR_CYAN, COLOR_BLACK);//using default colors to make "color pairs"
    init_pair(2, COLOR_BLUE, COLOR_BLACK);//first color listed is foreground
    init_pair(3, COLOR_RED, COLOR_YELLOW);//second color listed is background and that little number is the handle

    attrset(COLOR_PAIR(9));//set it to use one of the colors (cyan/black)
    mvaddch(5,4,'3');
    attrset(COLOR_PAIR(2));//changes color to red/yellow
    mvaddch(6,3,'H');
    mvaddch(3,3,219);//using an ascii amount instead of a "G" or "h" or "<"

    if(can_change_color()){printw("I can change colors :)");}//how you test if colors can be changed
    else{printw("I can't change colors :(");}//this test returns true on my pc, even though I don't have color support.
    refresh();

    while(1){
        getch();
    }
}
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

winner

  • Bay Watcher
    • View Profile
Re: sand dunes *updated*
« Reply #98 on: January 31, 2010, 06:43:53 pm »

thank you very much,
black background blue text. the '3' is cyan

?I can't change colors :(

 3
H


the '?' is it's representation of character 219
I shows me how to use the default colors but it looks it doesn't support color changes, thank you though.
« Last Edit: January 31, 2010, 07:12:18 pm by winner »
Logged
The great game of Warlocks!

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: sand dunes *updated*
« Reply #99 on: January 31, 2010, 08:09:10 pm »

You can only see a '?' ?
That is very odd.
It's just standard extended-ASCII.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

winner

  • Bay Watcher
    • View Profile
Re: Winners small games thread
« Reply #100 on: March 28, 2010, 09:22:19 pm »

I guess that means my creatures can't have funny names
Logged
The great game of Warlocks!
Pages: 1 ... 5 6 [7]