Onitama

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Onitama

Post by richmond62 » Tue Jul 26, 2022 8:00 pm

Onitama is an abstract game:
-
ONT.jpg
-
It retails for anywhere between 25 - 35 Euros.

Of course people who do not want to spend that sort of money and have
a bit of imagination can make their own version:
-
V.jpg
-
The rules are fairly straightforward:
-
onitama_rule_EN_0920.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Tue Jul 26, 2022 8:04 pm

So . . . to LiveCode:

So . . . to my Summer classes . . .

So . . . today I introduced this game to the boys and girls in the class and we played it and did
some sort of functional analysis of the game . . .

Those of the children who have Android phones and/or tablets installed the FREE

Onitama.apk package so they could play it and think about things on the bus on the way home.

https://m.apkpure.com/onitama-the-strat ... al.onitama

I gave them a stack like this:
-
SShot 2022-07-26 at 22.05.20.png
-
Where the board has started being constructed and the playing pieces are present.
Last edited by richmond62 on Tue Jul 26, 2022 9:20 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Tue Jul 26, 2022 8:08 pm

Then I rambled on about custom properties a bit . . .

Pointed out that the computer would need to 'see' on which square of the board
a piece was placed . . .

Then sent them home . . .
Attachments
Onitama_pupils_day_1.livecode.zip
Stack.
(12.02 KiB) Downloaded 49 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Tue Jul 26, 2022 8:14 pm

Now, not wanting to look unduly stupid in front of the children tomorrow
I sat down to do my homework:
-
SShot 2022-07-26 at 22.11.17.png
-
SShot 2022-07-26 at 22.11.59.png
-
Obviously this is NOT the complete game.

What is present is the ability to move pieces any where one wants (no restrictions of moves
imposed by cards yet), the inability to put 2 of one's pieces on the same square, the ability
to capture an opponent's piece, and a RESET button.
Attachments
Onitama.livecode.zip
Stack.
(12.88 KiB) Downloaded 46 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 8:19 am

So, here's a wee stack to pump out position cards:
-
Screen Shot 2022-07-27 at 10.16.49 AM.png
-
Stack deleted as improved version uploaded below.
Last edited by richmond62 on Wed Jul 27, 2022 10:52 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 10:13 am

Um . . .

Trying to mess around with custom properties
and wonder what is wrong with this:

Code: Select all

on mouseUp
   set the angle of img "K1" to 180
   if the P1 of img "K1" contains "L" then
      replace "L" with "R" in the P1 of img "K1"
      end if
end mouseUp

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Onitama

Post by Klaus » Wed Jul 27, 2022 10:25 am

Unfortunatly we cannot modify custom properties directly! :(
We need to store the value in a variable, modify that and set the modified CP back:

Code: Select all

on mouseUp
   set the angle of img "K1" to 180

   ## Also quotes for the name of a custom prop!
   put the "P1" of img "K1" into tP1
   if tP1 contains "L" then
      replace "L" with "R" in tP1
      set the "P1" of img "K1" to tP1
   end if
end mouseUp

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 10:51 am

Screen Shot 2022-07-27 at 12.50.43 PM.png
Screen Shot 2022-07-27 at 12.50.43 PM.png (9.64 KiB) Viewed 3411 times
-
This is a better card generator as it places a small, black dot at the top of each card.

Each of the squares surrounding the central green one can be clicked to set it as red or white.

Then a card can be generated: they will be named, sequentially: Kq, K2, K3 and so on.
-
oCards.jpg
Attachments
card maker.livecode.zip
Stack.
(2.61 KiB) Downloaded 52 times
Last edited by richmond62 on Wed Jul 27, 2022 1:45 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 11:19 am

Hmm . . .
-
cPropsR.jpg
-
We got 'off' on a long, complex and sweaty conversation about custom properties,
Onitama position cards, and, slightly oddly, Quadomino pieces today.
-
Screen Shot 2022-07-27 at 1.23.00 PM.png
-
All, good, clean fun. 8)
-
Quads.jpg
Quads.jpg (7.85 KiB) Viewed 3399 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 2:07 pm

SShot 2022-07-27 at 16.09.10.png
-
After some discussion we concluded that each card will have to have between 2 and 4 custom properties,
and HOW those custom properties are interpreted will depend on the angle of the card:
-
SShot 2022-07-27 at 16.16.48.png
SShot 2022-07-27 at 16.16.48.png (10.27 KiB) Viewed 3368 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 2:24 pm

SShot 2022-07-27 at 16.22.56.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 2:35 pm

SShot 2022-07-27 at 16.34.09.png
-
Here's a far, far more useful card maker.
Attachments
card maker.livecode.zip
Stack.
(54.76 KiB) Downloaded 55 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 3:54 pm

While I am aware that the vast majority of readers of these LiveCode Forums
make their bread and cheese in the "abstrusities" of 'serious' programming,
I have a continuing belief in:

1. The educational use of LiveCode to teach:

1.1. Programming concepts.

1.2. Abstract thinking.

1.3. Thinking laterally.

2. Taking something (a computer game, a computer program that does something other than
talk to other programs, a physical, abstract game) and getting an up-and-running, functional
model of that something as:

2.1. A way to learn computer programming.

2.2. Learn how to transfer skills.

2.3. Work out that 'fun' is not (and should not) something that consists of totally
mindless activity.

BUT, it should be emphasised, I am NOT first and foremost a programmer, I am first and foremost an educator
who believes:

3. Most people (children or adults) are NOT stimulated to think nearly as much as they should be.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 5:36 pm

Unfortunatly we cannot modify custom properties directly!
No, we cannot.

So, we will use the angle of a movement card to ascertain possible moves.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9355
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Onitama

Post by richmond62 » Wed Jul 27, 2022 5:38 pm

-
SShot 2022-07-27 at 19.43.31.jpg
-
SShot 2022-07-27 at 19.33.25.png
-
Having used my card maker stack to generate the standard
Onitama set of 16 cards along with custom properties
I have now got them tucked away on the stack so that 5 can be chosen at pseudo-random
and positioned for play.

The dot on each card serves as an indicator to us as to the card's angle.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”