|
Title: [FINISHED] Luna Post by: whitespace on February 23, 2009, 09:07:48 AM I made an oldschool lunar landing sim,
It's in javascript, I don't have a webspace to upload it though, you can save it in notepad with html extension and play it, or maybe someone is willing to upload it on his/her space? Code: <body onkeydown="k(event.keyCode)" style=font-family:monospace><script> y=0;t=-1;h=550;v=45;f=150;k(48); function k(e) { if (e>47 && e<58 && h>0) { y=e-48;t+=1;f-=y;if (f<0) {f=0;y=0};v+=(5-y);h-=v;if (h<0) {h=0}; if (h>0) { document.body.innerHTML="TIME:"+t+"<BR>HEIGHT:"+h+"<BR>SPEED:"+v+"<BR>FUEL:"+f+"<BR>BURN FUEL UNITS: (INPUT 0-9)<BR>"; } if (h==0 && v>5) { document.body.innerHTML="TIME:"+t+"<BR>HEIGHT:"+h+"<BR>SPEED:"+v+"<BR>FUEL:"+f+"<BR>YOU ARE ON THE MOON.<BR>YOU LANDED WITH A SPEED OF "+v+" M/S, NOW YOU ARE DEAD.<BR>REFRESH TO TRY AGAIN."; } if (h==0 && v<6) { document.body.innerHTML="TIME:"+t+"<BR>HEIGHT:"+h+"<BR>SPEED:"+v+"<BR>FUEL:"+f+"<BR>YOU ARE ON THE MOON.<BR>YOU LANDED SUCCESFULLY WITH A SPEED OF "+v+" M/S,<BR>IT TOOK YOU "+t+" SECONDS,<BR>YOU HAVE "+f+" FUEL UNITS LEFT,<BR>I WONDER WHAT YOU WANT TO DO HERE.<BR>REFRESH TO TRY BETTER."; }}} </script> I'm sorry, something is drawing me to minimalism always. [EDIT] I made my first C-program, it's the same game, but I'm kinda proud I finally made sth in C :) http://www.willhostforfood.com/access.php?fileid=61169 Title: Re: [FINISHED] Luna Post by: genericuser on February 23, 2009, 09:18:15 AM EDIT: Mirror's gone down. :( Pretty neat game :) Title: Re: [FINISHED] Luna Post by: nihilocrat on February 23, 2009, 09:20:56 AM Clever game. The complete lack of visual presentation outside of some instrumentation (or at least very limited) is something that I am probably going for in my game.
Looks like someone beat me to the punch, here's a mirror: http://nil.cjb.net/luna/ (http://nil.cjb.net/luna/) Title: Re: [FINISHED] Luna Post by: Traveller on February 23, 2009, 10:01:29 AM Fun! Very minimalistic code that is still very playable! I'm surprised how good the interface is, really. Not having to press enter is great. And replacing text instead of scrolling keeps the user's eye in the same place.
Personal best: Landed at 5 m/s, in 16 seconds, with 25 fuel left. Title: Re: [FINISHED] Luna Post by: J.G. Martins on February 23, 2009, 10:03:58 AM Code: TIME:21 HEIGHT:0 SPEED:5 FUEL:0 YOU ARE ON THE MOON. YOU LANDED SUCCESFULLY WITH A SPEED OF 5 M/S, IT TOOK YOU 21 SECONDS, YOU HAVE 0 FUEL UNITS LEFT, I WONDER WHAT YOU WANT TO DO HERE. REFRESH TO TRY BETTER. Woot! No fuel for takeoff. I really do wonder what I'm going to do on the Moon until the oxygen runs out! For some stupid reason, I also started out thinking the numpad was the direction, but that was because I didn't read the cockpit instructions properly ;) Title: Re: [FINISHED] Luna Post by: increpare on February 23, 2009, 10:08:01 AM hard! compelling, though.
Title: Re: [FINISHED] Luna Post by: ChrisFranklin on February 23, 2009, 10:09:00 AM Quote TIME:18 HEIGHT:0 SPEED:2 FUEL:12 YOU ARE ON THE MOON. YOU LANDED SUCCESFULLY WITH A SPEED OF 2 M/S, IT TOOK YOU 18 SECONDS, YOU HAVE 12 FUEL UNITS LEFT, I WONDER WHAT YOU WANT TO DO HERE. REFRESH TO TRY BETTER. What is "better?" Softer landing? More fuel left over? Quicker time? :( Title: Re: [FINISHED] Luna Post by: ElTipejoLoco on February 23, 2009, 10:38:54 AM I wish I could land in a crater. HEIGHT: -5
Okay, should go to class now. Title: Re: [FINISHED] Luna Post by: nihilocrat on February 23, 2009, 12:37:35 PM What is "better?" Softer landing? More fuel left over? Quicker time? :( Take a look at the source code. Look at all the possible "endings". It seems someone has set us up for.... A SUICIDE MISSION! :noir: Title: Re: [FINISHED] Luna Post by: PGGB on February 23, 2009, 02:40:38 PM That was fun. :)
Title: Re: [FINISHED] Luna Post by: [platypus] on February 23, 2009, 04:33:44 PM Nice gime, but I doubt that it's yours. :shrug2:
I coded this very same game with QBasic when I was a kid, and I copied it out from a book I lended from library. It was some kind of "learn to program"-book. It had almost exactly the same words (in finnish, but still). I'm not saying you couldn't enter with this, but since this has been done before, you should propably make a new game or improve this one. Title: Re: [FINISHED] Luna Post by: Fuzz on February 23, 2009, 05:10:59 PM If that's true, this is very ungentlemanly of you, whitespace. Try to be more :gentleman:.
Otherwise, cool game. Title: Re: [FINISHED] Luna Post by: whitespace on February 23, 2009, 09:07:10 PM Well, I certainly didn't had the intention to be no :gentleman:.
But you're right, for the people that haven't had zx81 or something equal: I didn't invent this game, the idea was written 30 years ago. There are several authors of several games on several platforms that have done same thing before. I seriously thought of this type of game as a genre. I'm sorry if it looked like I tried to be refreshing by taking things from the very past. Besides that I don't really understand why I would not be capable to write such simple game myself? I do think about the possibilities of making this game grow. I like the fact that you're looking at some bare-naked numbers, and still feel something through your fantasy. Title: Re: [FINISHED] Luna Post by: whitespace on February 23, 2009, 09:11:20 PM Quote TIME:18 HEIGHT:0 SPEED:2 FUEL:12 YOU ARE ON THE MOON. YOU LANDED SUCCESFULLY WITH A SPEED OF 2 M/S, IT TOOK YOU 18 SECONDS, YOU HAVE 12 FUEL UNITS LEFT, I WONDER WHAT YOU WANT TO DO HERE. REFRESH TO TRY BETTER. What is "better?" Softer landing? More fuel left over? Quicker time? :( Yep! Funny isn't it, how much depth in four variables? You can even try to make the slowest succesful landing. Title: Re: [FINISHED] Luna Post by: Fuzz on February 23, 2009, 09:34:03 PM Well, I certainly didn't had the intention to be no :gentleman:. Well, this is fine if you're taking the basic idea and running with it, which is what it seems like you're doing. If so, good job, sir. :gentleman:But you're right, for the people that haven't had zx81 or something equal: I didn't invent this game, the idea was written 30 years ago. There are several authors of several games on several platforms that have done same thing before. I seriously thought of this type of game as a genre. I'm sorry if it looked like I tried to be refreshing by taking things from the very past. Besides that I don't really understand why I would not be capable to write such simple game myself? I do think about the possibilities of making this game grow. I like the fact that you're looking at some bare-naked numbers, and still feel something through your fantasy. Title: Re: [FINISHED] Luna Post by: Traveller on February 23, 2009, 09:39:51 PM Yep! Funny isn't it, how much depth in four variables? You can even try to make the slowest succesful landing. There's only so much space to experiment sadly. To eventually stop, you need to expend 5 units of fuel per turn overall, plus 45 for a safe landing. 150 units of fuel means 21 seconds is the longest you can stay in the air. Now I feel like a rocket scientist. :wizard: Title: Re: [FINISHED] Luna Post by: whitespace on April 04, 2009, 01:05:19 PM I made my first C-program,
it's the same game, but I'm kinda proud I finally made sth in C :) http://www.willhostforfood.com/access.php?fileid=61169 (sorry windows only) the source is probably kinda embarrassing, but here you go: Code: #include <curses.h> int main() {while(1){ int row,col; int y=0; int t=-1; int h=550; int v=45; int f=150; int e=48; char tit[] = " "; char title[] = " LUNA "; char author[] = "by Whitespace"; char cockpit[] ="Tigsource Cockpit Competition 2009"; initscr(); curs_set(0); raw(); noecho(); clear(); start_color(); init_pair(1, COLOR_BLACK, COLOR_WHITE); attron(COLOR_PAIR(1)); getmaxyx(stdscr,row,col); mvprintw(row/2-1,(col-strlen(tit))/2,"%s",tit); mvprintw(row/2,(col-strlen(title))/2,"%s",title); mvprintw(row/2+1,(col-strlen(tit))/2,"%s",tit); attroff(COLOR_PAIR(1)); mvprintw(row/2+3,(col-strlen(author))/2,"%s",author); mvprintw(row/2+4,(col-strlen(cockpit))/2,"%s\n",cockpit); getch(); clear(); while (h>0) { clear(); y=e-48; t+=1; f-=y; if (f<0){ f=0; y=0; }; v+=(5-y); h-=v; if (h<0){ h=0; }; mvprintw(10,35,"Time:%d",t); mvprintw(11,35,"Height:%d",h); mvprintw(12,35,"Speed:%d",v); mvprintw(13,35,"Fuel:%d",f); attron(COLOR_PAIR(1)); mvprintw(15,25," Burn fuel units:(press 0-9) "); attroff(COLOR_PAIR(1)); if (h==0 && v>5){ clear(); char fail1[] = "You are on the moon."; char fail2[] = "You landed too fast."; char fail3[] = "Now you're dead."; mvprintw(row/2-1,(col-strlen(fail1))/2,"%s",fail1); mvprintw(row/2,(col-strlen(fail2))/2,"%s",fail2); mvprintw(row/2+1,(col-strlen(fail3))/2,"%s",fail3); break; }; if (h==0 && v<6){ clear(); char succ1[] = "You succesfully landed on the moon."; char succ2[] = "I wonder what you want to do here."; mvprintw(row/2-1,(col-strlen(succ1))/2,"%s",succ1); mvprintw(row/2,(col-strlen(succ2))/2,"%s",succ2); break; }; e = getch(); while(e<48 || e>57){ e = getch(); } } getch(); } endwin(); return 0; } Title: Re: [FINISHED] Luna Post by: Fuzz on April 04, 2009, 02:47:03 PM It looks much nicer now! :gentleman:
Title: Re: [FINISHED] Luna Post by: Cymon on April 10, 2009, 08:01:02 AM Aw, you know I love this game. Why didn't anyone tell me about it!
Can I put this game on Cymon's Games? Title: Re: [FINISHED] Luna Post by: whitespace on April 11, 2009, 03:54:16 AM Cymon:
I feel honoured, you may put it up on your site. I've been visiting your site frequently last weeks, cause I want to learn programming old C with Curses, and there are some nice, clean and simple examples on your page. Could you guide me to some good places on the internet where they specifically talk about C with Curses (Yes I've used google, only the info is pretty scattered I think)? +What is the best active curses-community on the net from what you know? I want to learn C while using curses directly from the start, instead of learning C with stdio first. Or do you think I should learn C from the simple tutorials (that use stdio) first and get into curses soon? Thanks for your interest, and thanks in advance for your answer. Title: Re: [FINISHED] Luna Post by: Cymon on April 11, 2009, 06:31:30 AM Cymon: http://www.cymonsgames.com/images/logo80x80.gif (http://www.cymonsgames.com/images/logo80x80.gif)I feel honoured, you may put it up on your site. Quote I've been visiting your site frequently last weeks, http://www.cymonsgames.com/images/logo80x80.gif (http://www.cymonsgames.com/images/logo80x80.gif) http://www.cymonsgames.com/images/logo80x80.gif (http://www.cymonsgames.com/images/logo80x80.gif)Quote Could you guide me to some good places on the internet where they specifically talk about C with Curses (Yes I've used google, only the info is pretty scattered I think)? +What is the best active curses-community on the net from what you know? As far as I know there isn't one. I think part of the problem is Curses isn't new. There's no active development community, which is a shame because I'm running out of Curses programs (http://cymonsgames.retroremakes.com/forum/index.php/topic,6.msg33.html#msg33). The cboard (http://cboard.cprogramming.com/) has some good curses programmers. GameDev (http://www.gamedev.net/community/forums/forum.asp?forum_id=61) too.I want to learn C while using curses directly from the start, instead of learning C with stdio first. Quote Or do you think I should learn C from the simple tutorials (that use stdio) first and get into curses soon? The advantage to stdio is the existence of cheat sheets (http://www.digilife.be/quickreferences/QRC/C%20Reference%20Card%20(ANSI)%202.2.pdf). I'm actually in the process of making a curses cheat sheet, tho, so that should change soon.Title: Re: [FINISHED] Luna Post by: whitespace on April 13, 2009, 07:57:55 PM Thanks for your reply,
I thought, since there are groups still making ascii-art, or demos in c64-asm, or games with pixels as big as pixels on a zx81, there should be a group of people besides the roguelike-developers, that like to make ascii games. Too bad. that cheatlist a nice idea Title: Re: [FINISHED] Luna Post by: Cymon on April 15, 2009, 09:19:04 AM Thanks for your reply, You know, I'd start one if I had any idea how to snag an audience.I thought, since there are groups still making ascii-art, or demos in c64-asm, or games with pixels as big as pixels on a zx81, there should be a group of people besides the roguelike-developers, that like to make ascii games. Too bad. that cheatlist a nice idea Title: Re: [FINISHED] Luna Post by: Will Vale on April 16, 2009, 01:07:39 AM I landed on my third or fourth go, lots of 7s until I got close to the ground, then 9s.
I think the minimalist title screen looks great. Title: Re: [FINISHED] Luna Post by: Ted on April 24, 2009, 11:17:37 AM I also loved it. How much of this is taken from a genre and how much is exactly copied?
YOU ARE ON THE MOON. YOU LANDED SUCCESFULLY WITH A SPEED OF 1 M/S, IT TOOK YOU 20 SECONDS, YOU HAVE 1 FUEL UNITS LEFT, I WONDER WHAT YOU WANT TO DO HERE. REFRESH TO TRY BETTER. Title: Re: [FINISHED] Luna Post by: Ted on April 24, 2009, 04:28:41 PM You should use this as your "cockpit" ;)
(http://www.oaktreeent.com/web_photos/Calculators/TI_86_Electronic_Calculator.jpg) |