Skip to content

Commit

Permalink
Pass on README
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Jul 12, 2024
1 parent 82b4af3 commit c29c2c8
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,25 @@ This repository contains examples of [Bloc](https://github.com/pharo-graphics/Bl

## Installation

In [Pharo](https://pharo.org/download) 11, evaluate:
In [Pharo](https://pharo.org/download), evaluate:

```smalltalk
Metacello new
baseline: 'BlocTutorials';
repository: 'github://pharo-graphics/Tutorials:dev-1.0/src';
repository: 'github://pharo-graphics/Tutorials:master/src';
load
```


## Memory Game Tutorial

This is a Memory Card game.
Please, find the code at the `Bloc-Memory` package.
This is a Memory Card game. Please, find the code at the `Bloc-Memory` package.

The present code is the result of following the Bloc tutorial in [this booklet](https://files.pharo.org/books-pdfs/booklet-Bloc/2017-11-09-memorygame.pdf), with some little name adaptations.
The source code for such booklet can be found [here](https://github.com/SquareBracketAssociates/Booklet-BuildingMemoryGameWithBloc).


![Window](OSWindow.png)


To start it, evaluate this code:

```smalltalk
Expand All @@ -40,30 +37,26 @@ aGameElement := MGGameElement new
"The space represents the window"
space := BlSpace new.
space addChild: aGameElement.
space root addChild: aGameElement.
"Calculate the extent of the game board for the first time, to set it to the window."
space pulse.
space extent: aGameElement extent.
"Resize the space to the extent of the game board for the first time (this is known when the layout is applied)"
space root whenLayoutedDoOnce: [ space extent: aGameElement size ].
"Show the window"
space show.
space show.
```

By default, a Morphic window will popup. It is also possible to open a OS "external" window. To do it, open "System Settings > Appearance > Bloc" and select "OSWindow - SDL2" in "Preferable Host".
By default, a OS "external" window will popup. It is also possible to popup a Morphic window. To do it, open "System Settings > Appearance > Bloc" and select "SDL2" in "Preferable Host".


## Reordering Examples

This example shows how to use drag-and-drop, and it's written using Bloc and Brick.

![Reordering Capture](https://cdn.discordapp.com/attachments/375240886319316994/917496462777135174/unknown.png)
This example shows how to use drag-and-drop, and it's written using Bloc.

To execute it, evaluate the following code:

```smalltalk
BlPaneCreatingReorderingHandler new
fittingColumnsExample
BlPaneCreatingReorderingHandler new fittingColumnsExample
```

Thanks @StephanEggermont for the contribution.
Expand Down

0 comments on commit c29c2c8

Please sign in to comment.