Qbasicnews.com

QbasicNews.Com => Challenges => Topic started by: Z!re on October 02, 2005, 12:40:37 PM



Title: 1 key challenge revisited
Post by: Z!re on October 02, 2005, 12:40:37 PM
Challenge:
Make a game that uses only one key as input


Rules:
QB or FB
NO mouse
Game must be driven by one key only
Game menus can have multiple key inputs or mouse
Game end key does not count into the one key limit
Key to bring up menu or pause does not count into the one key limit
Multiple entries are allowed
Sources and all needed binaries must be included in any release (need hosting?: www.fileanchor.com)


Judging:
Vote, for most entertaining/best/etc/yadda yadda


Time:
Challenge ends at November 8th, with a 7 day vote before QB Express.


Title: 1 key challenge revisited
Post by: red_Marvin on October 02, 2005, 01:35:30 PM
I'll try to enter this one, right now I have no ideas, and I have a feeling
that free time might be a problem in the immediate future, but, well see. :)


EDIT: No I will not participate in this one, I seem to lack programming
motivation in general...


Title: 1 key challenge revisited
Post by: Dio on October 02, 2005, 07:17:47 PM
this is the first thing that came to mind: (which evadently is usally a bad thing)

FB:

Code:
? "RULES:"
? "press the space bar when you are over a gap."
? "to exit, press Esc key"
dim cb(1000)
sleep 5000
screen 13,,,1:randomize timer
line (0,0)-(319,199),2,b
for y = 0 to 197 step 2
line (0,y)-(319,y),2
x = int((314-4+1)*rnd+4)
if y > 0 then line (x-2,y)-(x+4,y),0
next
for y = 197 to 198
for x = 1 to 318 step 2
  if x = 1 and y = 198 then x = x +1
  pset (x,y),15
next
next
get (1,197)-(318,198),cb
x = 1:y = 1
windowtitle "I rule!"
dc = 15
do
  setmouse 0,0,0
  if y = 197 or y = 198 then locate 8,16:print "YOU WIN!" :SLEEP :END
  ox = x
  if a = 0 then x = x + 1:if x = 319 then a = 1
  if a = 1 then x = x - 1:if x = 1 then a = 0
  for dlay = 0 to 10000000:next
  pset (ox,y),bgd:pset (x,y),dc
  press$ = inkey$
  if press$ = chr$(27) then end
  if press$ = " " then
    if point (x,y+1) = bgd then pset (x,y),bgd:y = y +2 :goto 1
    if point (x,y+1) <> bgd then
      cc = point (0,0)
      select case cc
        case 2
          for cy = 0 to 199
          for cx = 0 to 319
            if point (cx,cy) = 2 then pset (cx,cy),44
            if point (cx,cy) = 0 then pset (cx,cy),15:dc = 0:bgd = 15
           
          next
          next
          put (1,197),cb,pset
        case 44
          for cy = 0 to 199
          for cx = 0 to 319
            if point (cx,cy) = 44 then pset (cx,cy),4:dc = 15:bgd = 0
            if point (cx,cy) = 15 then pset (cx,cy),0:
          next
          next
          put (1,197),cb,pset

        case 4
          locate 8,16:? "YOU LOSE!":SLEEP :end
      end select
    end if
  end if
1
loop


edit: update
edit: i'm really obsessive as it turns out.


Title: 1 key challenge revisited
Post by: urger on October 02, 2005, 10:37:37 PM
I'll be entering this compo (have some work to do before I have something to show)

That game you posted there looks interesting, but it's far to small in windowed mode to play :(


Title: 1 key challenge revisited
Post by: moochthemonkey on October 03, 2005, 12:34:32 AM
Are brain waves allowed to play the game?

If so...I might be able to enter a challenge for the first time..


Title: 1 key challenge revisited
Post by: Dio on October 03, 2005, 04:01:26 AM
Quote from: "urger"
That game you posted there looks interesting, but it's far to small in windowed mode to play :(


yeah i know, that's what Alt + Enter are for. ;)

speaking of which, how would i get it to open fullscreen automatically?


Title: 1 key challenge revisited
Post by: Anonymous on October 03, 2005, 04:22:50 AM
Code:
screen 13, , , 1


Title: 1 key challenge revisited
Post by: Rattrapmax6 on October 03, 2005, 01:52:54 PM
Quote from: "Cha0s"
Code:
screen 13, , , 1


That game sucks....  :lol:

j/k (I know you was showing Dio full screen mode...) :rotfl:


Title: 1 key challenge revisited
Post by: rpgfan3233 on October 03, 2005, 01:59:44 PM
Quote from: "Rattrapmax6"
Quote from: "Cha0s"
Code:
screen 13, , , 1


That game sucks....  :lol:

j/k (I know you was showing Dio full screen mode...) :rotfl:

What are you talking about!? You can make up whatever imaginary game you want from a blank screen! :-P


Title: 1 key challenge revisited
Post by: Z!re on October 03, 2005, 02:18:04 PM
Quote from: "rpgfan3233"
Quote from: "Rattrapmax6"
Quote from: "Cha0s"
Code:
screen 13, , , 1


That game sucks....  :lol:

j/k (I know you was showing Dio full screen mode...) :rotfl:

What are you talking about!? You can make up whatever imaginary game you want from a blank screen! :-P
It doesent use a key for input, it's dissqualified!


Title: 1 key challenge revisited
Post by: Rattrapmax6 on October 03, 2005, 02:23:50 PM
Quote from: "Z!re"
Quote from: "rpgfan3233"
Quote from: "Rattrapmax6"
Quote from: "Cha0s"
Code:
screen 13, , , 1


That game sucks....  :lol:

j/k (I know you was showing Dio full screen mode...) :rotfl:

What are you talking about!? You can make up whatever imaginary game you want from a blank screen! :-P
It doesent use a key for input, it's dissqualified!


 :lol: [yoda]Only one key there is, no more, no less.[/yoda]


Title: 1 key challenge revisited
Post by: whitetiger0990 on October 03, 2005, 06:21:21 PM
Simple solution
Code:
screen 13, , , 1
do:loop until inkey$="g"




Hehe I'll think of a game. I was going to enter the old one but didn't


Title: 1 key challenge revisited
Post by: KiZ on October 03, 2005, 06:37:28 PM
Quote from: "whitetiger0990"
I was going to enter the old one but didn't


Me too :) I had an awesome game called the running man, where you had to make a man jump over obstacles while running. Pretty tricky, but fun none the less :D


Title: 1 key challenge revisited
Post by: urger on October 03, 2005, 06:44:09 PM
Rules question:
Could mouse clicks be used as the "one key" if only the status of the mouses buttons were monitored?  Positioning of the mouse wouldn't matter, only the fact that it was clicked.


Title: 1 key challenge revisited
Post by: whitetiger0990 on October 03, 2005, 09:37:53 PM
Couldn't you easily replace that with a keyboard key?


Title: 1 key challenge revisited
Post by: Z!re on October 03, 2005, 09:40:10 PM
Quote from: "urger"
Rules question:
Could mouse clicks be used as the "one key" if only the status of the mouses buttons were monitored?  Positioning of the mouse wouldn't matter, only the fact that it was clicked.
If only ONE if the mouse buttons count ya..

Well, as long as they dont do different things, if you want you can trap all keys, and all mouse movement and input.. as long as it only ends up doing one thing.

Code:
if inkey$ = "q" or inkey$ = "w" or [...] or mouseBTN <> 0 or mouseX [...] then
 Do one thing
end if


Title: 1 key challenge revisited
Post by: urger on October 03, 2005, 09:47:38 PM
Woohoo :D
Introducing my entry into this compo: Circulousity
In production screenshot:
(http://fileanchor.com/4558-t.png) (http://fileanchor.com/4558.png)
Select thumbnail to open a fullsize image (warning: very large)
Developed and running under Ubuntu


Title: 1 key challenge revisited
Post by: red_Marvin on October 08, 2005, 02:40:49 PM
Must the key be a physical key on the keyboard/mouse/etc or can
it be a key/button in a gui?

-> if you click at area A you choose new game, B=exit, C=help ...
Z=The gameplay input method.

It will still be a binary way of inputting (on or off) and the only way to
act in the game (the other buttons in the gui is for menu's and stuff)


Title: 1 key challenge revisited
Post by: Z!re on October 11, 2005, 03:50:01 PM
You can do whatever you want for menus etc..
you can have a clickable button to bring up a menu, to pause or to quit..

The GAME, has to be driven by a single key, or mouse button...


Menus, pause, or other such things, do NOT count as game keys..


Title: 1 key challenge revisited
Post by: red_Marvin on October 12, 2005, 04:18:53 AM
So no gui simulated-single-button based input then... OK


Title: 1 key challenge revisited
Post by: d.j.peters on October 12, 2005, 07:29:30 AM
An example of one key onlinegame.
Start your engine (http://www.crashtestdummyolympics.co.uk/highjump.html)

It's not from me.
Joshy


Title: 1 key challenge revisited
Post by: rpgfan3233 on October 12, 2005, 12:31:55 PM
Quote from: "d.j.peters"
An example of one key onlinegame.
Start your engine (http://www.crashtestdummyolympics.co.uk/highjump.html)

It's not from me.
Joshy

Here's another example (similar to the Pingu Throw/Yeti Sports games, but with some extra twists. . .): http://edamamebeans.com/games/index.php


Title: 1 key challenge revisited
Post by: urger on October 12, 2005, 06:05:08 PM
Circulosity, an entry into the 1 key challenge revisted
Click screenshot to download
[warning to 56k'ers file is 2.23MB]
 (http://www.lenzelectricanddata.com/circ_screen.jpg)  (http://www.lenzelectricanddata.com/circulosity.zip)
*Edit* File rehosted at FileAnchor mow that it is back
*Edit* Re-rehosted back to my own webspace


Title: 1 key challenge revisited
Post by: j2krei08 on October 18, 2005, 05:57:37 PM
Here's mine.  It's called Hurdles (http://www.geocities.com/j2krei08/Hurdles.zip), because you jump over the hurdles.  No sound, kinda simple.  I made it in about an hour.

No documentation, though.  Press space to jump.  If you jump over 10 hurdles or more, you win.  Any less and you get a lower score.


Title: 1 key challenge revisited
Post by: speedlemon on October 18, 2005, 06:20:35 PM
Both of these games were elegant gems.

However I would like to make some suggestions for both of you.

Urger-
This game, had a cool idea.  The die sound effect didn't match the rest of the game (In my opinion anyway).  But I like how you thought of the idea for it, and it was coded very elegantly.  The only problem I really had with it, is after a while I got bored with it.

John-
This game was almost unplayable.  Unless it was supposed to go that fast...
I also didn't like when 2 hurdles went so close together.  I thought in hurdles they were spread out evenly.  Other than that, the graphics were elegant. (apart from the 'runner', but I understand that you did make it in 30 minutes.)
Oh, and you might want to do something about the mouse.
try-
Code:
setmouse 0,0,0
'Hint: this only works in FB




Hopefully I'll be getting my entry in soon. :roll:


Title: 1 key challenge revisited
Post by: urger on October 18, 2005, 10:16:20 PM
Quote
Urger-
This game, had a cool idea. The die sound effect didn't match the rest of the game (In my opinion anyway). But I like how you thought of the idea for it, and it was coded very elegantly. The only problem I really had with it, is after a while I got bored with it.

Thanks :D
I wanted the Die sound to be jarring abit.  I couldn't think of a more jarring sound then of a person empting the air from thier bagpipes so I recorded my friend doing that, however it the recording didn't come out how I had planned, so I went with that sound in the game instead.
As for the boring bit, well, there is only so much you can do with only one key to make it interesting. :-? The game speeds up considerably over time, best I could figure to make it more difficult without over complicating the game.  I'd love to hear other peoples suggestions.


Title: 1 key challenge revisited
Post by: whitetiger0990 on October 18, 2005, 10:36:40 PM
@urger: I can't get it to run on linux =(

I removed all the FMOD stuff.


Title: 1 key challenge revisited
Post by: urger on October 18, 2005, 11:02:20 PM
Quote
@urger: I can't get it to run on linux =(

I removed all the FMOD stuff.

Thats weird, since I coded the whole thing in Linux except for the sound.
What is the error you get?


Title: 1 key challenge revisited
Post by: whitetiger0990 on October 18, 2005, 11:17:00 PM
Quote from: "urger"
Quote
@urger: I can't get it to run on linux =(

I removed all the FMOD stuff.

Thats weird, since I coded the whole thing in Linux except for the sound.
What is the error you get?

None. It compiles fine and when I run it it pops up (taking almost the full screen)
here's a screeny
(http://fileanchor.com/6809-t.png) (http://fileanchor.com/6809.png)
When I click any button the dot rotates to the right (in one of 3 slots)

I can hit escape and then i can't do anything. nothing shows up. After that I hit 'y' and it ends.


Title: 1 key challenge revisited
Post by: urger on October 18, 2005, 11:21:06 PM
Could you PM or post your modified code.
I'm going to try it and see if I get the same results.

*edit*
Also you may want to try this code.
http://fileanchor.com/6810-d
I haven't been able to test it yet (not home with my Ubuntu comp right now) but this should be platform independant graphics code.

After taking a look at your screen shot it strikes me that what could be the problem is that timed graphics update code isn't being triggered.  If the code is being triggered you'll be able to see the "circles" move in numeric form.
*edit 2*
Text mode circulosity code
http://fileanchor.com/6826-d


Title: 1 key challenge revisited
Post by: whitetiger0990 on October 19, 2005, 12:18:03 AM
Neither of those work for me. The graphics one is still broken the same way and the text one. well nothing shows up. (but when I hit esc it says "q u i t  y / n")



...wait I got it! right before the first DO I put "updateon=timer"


Title: 1 key challenge revisited
Post by: urger on October 19, 2005, 09:54:37 AM
Hmm, I wonder why you needed to do that
Updateon should initalize to 0. Since your timer would always evaluate to higher then 0 the update screen code should be tiggered.  What does updateon equal before you set it to equal timer?


Title: 1 key challenge revisited
Post by: j2krei08 on October 19, 2005, 03:37:40 PM
Thanks, but I hardly consider it a gem :lol: smilies are back!

I made it fast because anything slower is kinda boring.  Maybe I'll put a skill level on it.


Title: 1 key challenge revisited
Post by: speedlemon on October 19, 2005, 05:49:40 PM
i guess if it's meant to be fast like that... im just saying the way it is now is almost unplayable.


Title: 1 key challenge revisited
Post by: Dio on October 19, 2005, 09:07:53 PM
i first thought it was a way to test how fast someone’s computer was. like seeing how many cycles it could do in a second and thru some formula do something or other. geez im a lazy typist.

like this:
Code:
stimer = timer
for i = 0 to 10000000000
    if timer > stimer +1 then :ii = i:exit for
    if timer < stimer then stimer = 86400 - stimer: stimer = 0 - stimer
next
? ii
sleep


hence, the bigger the number, the faster the computer.

edit: regarding my other post, i added a safety net for midnight


Title: 1 key challenge revisited
Post by: Pyrokid on October 30, 2005, 03:10:15 AM
Quote from: "Dio"
Code:
stimer = timer
for i = 0 to 10000000000
    if timer > stimer +1 then :ii = i:exit for
    if timer < stimer then stimer = 86400 - stimer: stimer = 0 - stimer
next
? ii
sleep

That isnt really needed in fb it would probably be better if you used SLEEP ms


Title: 1 key challenge revisited
Post by: Z!re on November 13, 2005, 01:30:12 AM
Well.. challenge is pretty much over, if you have any entries that you havent sent in for some weird reason, do so now..