Author Topic: [Inform Rock Paper Scissor game]  (Read 27058 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
[Inform Rock Paper Scissor game]
« 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
* [Inform_PaperRockScissor].rar (Filesize: 343.54 KB, Downloads: 581)
Programming isn't difficult, only it's  consuming time and coffee

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #1 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
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #2 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!
RPSLS.PNG
* RPSLS.PNG (Filesize: 48.43 KB, Dimensions: 885x726, Views: 850)
« Last Edit: October 08, 2018, 08:25:39 pm by bplus »

FellippeHeitor

  • Guest
Re: [Inform Rock Paper Scissor game]
« Reply #3 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).

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #4 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.
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #5 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
you'll find our new game! :-)

see here some screenshots
PaperRockScissor_Game 1 vs 2.jpg
* PaperRockScissor_Game 1 vs 2.jpg (Filesize: 168.71 KB, Dimensions: 894x612, Views: 817)
PaperRockScissor_Game Start 1 vs 2.jpg
* PaperRockScissor_Game Start 1 vs 2.jpg (Filesize: 203.01 KB, Dimensions: 895x624, Views: 802)
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #6 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.
Programming isn't difficult, only it's  consuming time and coffee

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: [Inform Rock Paper Scissor game]
« Reply #7 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)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: [Inform Rock Paper Scissor game]
« Reply #8 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.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #9 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
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #10 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 :-)

* RockScissorPaper_Halloween.rar (Filesize: 146.51 KB, Downloads: 527)
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #11 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

Great!
Programming isn't difficult, only it's  consuming time and coffee

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #12 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
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #13 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....
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: [Inform Rock Paper Scissor game]
« Reply #14 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.
« Last Edit: December 17, 2018, 09:18:31 am by bplus »