Welcome Guest [Log In] [Register]
Add Reply
Attributes Ep. 2 & 3; Luck and Endurance
Topic Started: Jan 18 2008, 06:36 PM (873 Views)
Kyros the Hedgehog
Member Avatar
(still) a dude with a funky headband
[ * ]
Hi everyone! remember my game Persistence? yeah. Anyway, I'll say that was the first of my little "attributes" series of games.

so, after a month or so, I made new ones. like persistence, they require the attribute of their name to complete, or score high on.

so...

Luck- you press one of two to five buttons. If it's a randomly selected bad button, you die. if it's good, you score and start over.

my best score was 40, with three buttons (you score more for having fewer buttons)

Endurance- you press a button, over and over. stop and it ends. keep doing it and you score higher until you can endure no more.

I'll be posting the source code shortly....
The companion cube
will not threaten to stab you.
The cake is a lie.
Spoiler: click to toggle
that is a real spoier for a real thing that you may not want to know of (that is, if you own or will own yet haven't beaten Valve's game Portal). it's not like, to make you lose... uh... I'll stop now.
Offline Profile Quote Post Goto Top
 
techwizrd
Member Avatar
Magister ex Machina
[ *  *  * ]
Why do you make games like that? That persistence one was a pain...

BTW, I wrote that Endurance one in Tkinter. I'll upload the code shortly...
My DeviantArt user page Please comment and add me to your favorites!
Posted Image
Offline Profile Quote Post Goto Top
 
Kyros the Hedgehog
Member Avatar
(still) a dude with a funky headband
[ * ]
heh. to answer your question, I get really bored sometimes. "Luck" and the beginning of "Endurance" began in band after I was done taking a test. "Persistence" was made on the bus when nobody was talking to me.

So, basically, it's never far out of my reach. And because i can!

on to the code...


Luck
this game's OK. its size kinda bothers me. I'm open to optimization suggestions.

notes on notation-
!= not equal
=> greater than/equal
<= less than/equal
-> store variable
_ is a not-overly-obvious blank space

Code:
 
program:luck
:Clrhome
:disp "how many?
:input "buttons?(2-5)_ _ _", A
:0->X
:int(A
:If A>5:5->A
:If A<2:2->A
:If A=2:"2->str1
:If A=3:"3->str1
:If A=4:"4->str1
:If A=5:"5->str1
:"1 to_"+str1->str1
:while 1
:disp "press a button", str1
:0
:while Y!=0:getkey->Y:end

note: yes, I do know about answer variable, but apparently the next few lines mess it up, so I didn't use it. don't bother me about this. continuing on...
Code:
 
:if Y=92: 1->Y
:if Y=93: 2->Y
:if Y=94: 3->Y
:if Y=82: 4->Y
:if Y=83: 5->Y
:if Y=>1 and Y<=5:goto T
:0->Y
:Lbl T
:if Y=randint(1,A) or Y>A or Y=0: goto S
:X+(-A+7)->X
:clrhome
:disp "you didn't die."
:end
:Lbl S
:disp "you luck has","Run out!","","your score:",X



how to play
 
select how many buttons you want. then press the applicable ones until you die. note that pressing buttons that aren't even involved in the game will result in the game ending. fewer buttons = higher score incrementation number

I think i said this above, but my best was 40 points.
The companion cube
will not threaten to stab you.
The cake is a lie.
Spoiler: click to toggle
that is a real spoier for a real thing that you may not want to know of (that is, if you own or will own yet haven't beaten Valve's game Portal). it's not like, to make you lose... uh... I'll stop now.
Offline Profile Quote Post Goto Top
 
Kyros the Hedgehog
Member Avatar
(still) a dude with a funky headband
[ * ]
endurance--
I'm trying to make a similar one called "patience," where you just hold a button. I need to work out how to get the calculator to detect button holding (not just pressing). PM me if you have a good, confirmed answer. Anyhow, I was feeling lazy, so Patience devolved to this. And yes, I am open to optimization tips.

same notation notes as above
Code:
 
Program:endure
:0->X
:disp "Endurance","","Press 2nd","To begin"
:repeat Ans=21:getkey:end
:clrhome
:disp "go!"
:Lbl 1
:0->Y
:Repeat ans=21 or Y=15
:Y+1->Y
:getkey
:end
:if Y=15
:goto S
:X+1->X
:goto 1
:Lbl S
:clrhome
:disp "done! score:",x



how to play
 
Press 2nd until you can press no more. note that holding the button to cheat doesn't work.

a note on the speed of the game: you don't have to press insanely fast. if you do it too quickly, the game fails to register some of your pushes. swift, steady pulses are good (a good musical term comes to mind: staccato)

my current best is 115.

TTFN, folks
The companion cube
will not threaten to stab you.
The cake is a lie.
Spoiler: click to toggle
that is a real spoier for a real thing that you may not want to know of (that is, if you own or will own yet haven't beaten Valve's game Portal). it's not like, to make you lose... uh... I'll stop now.
Offline Profile Quote Post Goto Top
 
techwizrd
Member Avatar
Magister ex Machina
[ *  *  * ]
Please note, lower case characters take up 2 bits while upper case characters take only 1. Antoher suggestion would be too put all your Labels at the begining of the program. When the calculators fings a Goto, it starts from the top of the program and searches downwards. overall, I think that this is a very good time waster. I might try to elaborate on this game and put all the Attribute games into a little Basic App or all in a navigable program of some kind.
My DeviantArt user page Please comment and add me to your favorites!
Posted Image
Offline Profile Quote Post Goto Top
 
MushroomDude
No Avatar
Not Lurking
[ * ]
hahaha
That's hilarious.
Offline Profile Quote Post Goto Top
 
techwizrd
Member Avatar
Magister ex Machina
[ *  *  * ]
MushroomDude
Jan 22 2008, 06:26 PM
hahaha
That's hilarious.
Yes, yes it is. Kyros is exactly the type of person who would write this sort of code.
My DeviantArt user page Please comment and add me to your favorites!
Posted Image
Offline Profile Quote Post Goto Top
 
Kyros the Hedgehog
Member Avatar
(still) a dude with a funky headband
[ * ]
thanks... I can't really tell if that's a dis or a compliment.
The companion cube
will not threaten to stab you.
The cake is a lie.
Spoiler: click to toggle
that is a real spoier for a real thing that you may not want to know of (that is, if you own or will own yet haven't beaten Valve's game Portal). it's not like, to make you lose... uh... I'll stop now.
Offline Profile Quote Post Goto Top
 
techwizrd
Member Avatar
Magister ex Machina
[ *  *  * ]
Kyros the Hedgehog
Jan 25 2008, 12:29 PM
thanks... I can't really tell if that's a dis or a compliment.
Neither can I. Neither can I.

Anyway, you do realize 'dis' is spelled with 2 's' like this: diss. Whatever.
My DeviantArt user page Please comment and add me to your favorites!
Posted Image
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Finished Projects · Next Topic »
Add Reply