QB64.org Forum

QB64 Team Software => InForm => InForm-based programs => Topic started by: TempodiBasic on October 08, 2018, 06:20:08 PM

Title: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on October 08, 2018, 06:20:08 PM
Hy Guys
Here I post a my little program
The Inform version of Rock Paper Scissor. Building it in Inform has been interesting to re-think some ideas under the light of evnt driven coding.
So in compressed file attached you get the Assets folder for image files, the .FRM and 2 file .BAS because I hae used 2 different ways to get the pause between two different moments of the output

in the first the flow in modulated by this
Code: QB64: [Select]
  1.  
  2.     IF PlayerChoose = 20 THEN ' wait 2 sec
  3.         in! = TIMER
  4.         DO WHILE TIMER - in! < 2
  5.         LOOP
  6.         restoreGame
  7.     END IF
  8.     IF PlayerChoose THEN PlayerChoose = PlayerChoose + 1 ' here we pass one time(20 frames) into sub_Display before to reset the game
  9.  

in the second way I have used a more suitable QB64 code
Code: QB64: [Select]
  1.  
  2.  
  3.     IF PlayerChoose THEN _DELAY 1
  4.     IF PlayerChoose = 5 THEN restoreGame
  5.     IF PlayerChoose THEN PlayerChoose = PlayerChoose + 1 ' here we pass one time(20 frames) into sub_Display before to reset the game
  6.  

Thanks to try
Welcome feedback
Title: Re: [Inform Rock Paper Scissor game]
Post by: Pete on October 08, 2018, 06:35:55 PM
I'll wait for BPlus to make it into...

Rock-Paper-Scissors-Lizard-Spock.

I'll check back in 10-minutes.

Pete :D
Title: Re: [Inform Rock Paper Scissor game]
Post by: bplus on October 08, 2018, 08:03:13 PM
Hey Pete, you've seen that? :D

Hi TempodiBasic, worked without a hitch. You give points for ties? Good way to get quarters!
Title: Re: [Inform Rock Paper Scissor game]
Post by: FellippeHeitor on October 09, 2018, 03:21:43 AM
That was fun, Tempodi! Thanks for sharing.

BTW, if you just set the pictures .Hidden property to true it's already enough to keep users from clicking them - no need to also set .Disabled = True.

Disabled is usually to indicate a control can't be clicked (although it's still visible) since that'll make it look different. For a picture box that wouldn't make sense, so you're right to hide them (in which case hiding is enough).
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on October 09, 2018, 09:19:00 AM
Thanks Fellippe
this is one of the bad behaviours that I must kill, coming from previous experience with other RAD WYGISWYG programs.
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on October 09, 2018, 06:53:46 PM
@Bplus

please go to see at this link https://www.qb64.org/forum/index.php?topic=686.0 (https://www.qb64.org/forum/index.php?topic=686.0)
you'll find our new game! :-)

see here some screenshots
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on October 09, 2018, 06:56:48 PM
@Fellippe

about
Quote
BTW, if you just set the pictures .Hidden property to true it's already enough to keep users from clicking them - no need to also set .Disabled = True.
it is equal to say that I cannot use an hidden item (button, radiobutton, checkbox, switch) that interacts with user...
I must find another way to code a joke that I have in mind.
Title: Re: [Inform Rock Paper Scissor game]
Post by: SMcNeill on October 09, 2018, 07:06:08 PM
@Fellippe

about
Quote
BTW, if you just set the pictures .Hidden property to true it's already enough to keep users from clicking them - no need to also set .Disabled = True.
it is equal to say that I cannot use an hidden item (button, radiobutton, checkbox, switch) that interacts with user...
I must find another way to code a joke that I have in mind.

Can you set the button to a transparent color? _RGBA32(0,0,0,0)
Title: Re: [Inform Rock Paper Scissor game]
Post by: FellippeHeitor on October 09, 2018, 08:07:11 PM
Buttons won't go transparent but, if you must, you can have a transparent picture box with no border, as that would likely fit what you seem to want to do.
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on October 11, 2018, 07:38:10 AM
@Steve 
thanks for the idea

@Fellippe
thanks for the feedback and the idea to get a invisible item that responds to clickevent
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on November 01, 2018, 12:59:32 PM
Good Halloween  spent!

Here attached an Halloween version of Rock Paper Scissor.
That original not the pentaversion :-)

Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on December 13, 2018, 11:10:22 AM
Hi
I cannot believe to my eyes

there is an history behind Rock Paper Scissor Spock Lizard....
https://it.wikipedia.org/wiki/Morra_cinese#La_variante_con_Lizard_e_Spock (https://it.wikipedia.org/wiki/Morra_cinese#La_variante_con_Lizard_e_Spock)

Great!
Title: Re: [Inform Rock Paper Scissor game]
Post by: Pete on December 13, 2018, 12:22:24 PM
Yeah, I hope you didn't think I made it up. The first time I saw the game was on an American TV comedy series, The Big Bang Theory.



Pete
Title: Re: [Inform Rock Paper Scissor game]
Post by: TempodiBasic on December 16, 2018, 05:14:37 PM
@Pete
really I have no information about that series on TV (now it seems that I find it everywhere),  so I have imagined that it was born from a joke in chat among you, Bplus and someone others...
it is like an accumulation point....
Title: Re: [Inform Rock Paper Scissor game]
Post by: bplus on December 17, 2018, 09:09:10 AM
I coded the game (reply #2 screen shot) from the Big Bang Theory Trivia Game back in 2015-08-09.

You can play it on Android device if you download SmallBASIC (free) from Google Play Store.
It is an "on-line" sample (see SmallBASIC Menu in Navigation screen) simply designed to play with touch screen or mouse.

Pete knows about my interest because he has tried SmallBASIC.