WorkShop 0005 StoryTelling

I have enjoyed this Workshop a lot, and I would have enjoyed it more if I hadn’t had to start it again 3 times. The first time, I forgot to save it, or I didn’t save it, I don’t remember it well. And the second time I had a weird supper bug in which all the Passages() were blocked and I couldn’t edit them.

But anyway I have to say that repeating it 3 times has helped me to find out how many macros, code, css and ways to tell a story work.

Root – Interactive History.

For my interactive story I’ve been a little inspired by the game “The Standly Parable.” Or somehow try to show the Narration as they did in this game. I have discovered that it is not easy to tell a story with rhythm, only with words and a few links… You need to get the person’s attention and not get bored. On this subject I have to investigate and learn even more.

On the other hand I have seen that Twine is a great tool, not only to create Interactive Stories, but as Story board with code. This is great. Because I see it as a great way to prepare your projects, and then move them to other platforms.

//Three Act Structure

It took me a long time to get started. I knew approximately what I wanted to tell, but I didn’t know which way to go or which routes I wanted, how many characters, if my characters were going to talk a lot or not. The only thing that was relatively clear was the protagonist and the finals.

https://i.imgur.com/e9QKNfc.png

It was stuck and I couldn’t go on. But thanks to my partner Elisabella I managed to continue my interactive story. She recommended me to do the Three Act structure. And there to go putting the strongest points of my history. And from then on I added more and more information, more text and more possibilities.

This methodology for narrative has enchanted me, it has made me see that stories can be taken out of the mind, in a more orderly and meaningful way.

Walking Dead

The Standly Parable

// Time Code

:: StoryTitle
Delayed Text in SugarCube

:: Start
<<timed 5s>>
It has been 5 seconds. Show the text!
<</timed>>

//Locks and Doors

:: StoryTitle
Lock and Key: Variable in SugarCube

:: Start
<<set $key to false>>

Rooms:
[[Back Room]]
[[Front Room]]

:: Back Room
<<if $key is false>>
    Items:
    <<linkreplace "Pick up the key">><<set $key to true>>You have a key.<</linkreplace>>
<<else>>
    There is nothing here.
<</if>>

Rooms:
[[Front Room]]

:: Front Room
<<if $key is true>>
    [[Exit]]
<<else>>
    Locked Door
<</if>>

Rooms:
[[Back Room]]

:: Exit
You found the key and went through the door!
<<link "Open dialog!">>
    <<script>>
        Dialog.setup("Dialog");
        Dialog.wiki("Text within the dialog window");
        Dialog.open();
    <</script>>
<</link>>

//Open Dialog

I used that Script to open a window, when pick up a object.

// Stadistics

This code modifies variables on screen, and updates them, to check them later. Although I have not used this code, I have left it here because I found it interesting enough to use in the future. Who knows.

:: StoryTitle
Player Statistics in SugarCube

:: Start
Empathy: \
<<link "[+]">>
    <<if $totalPoints gt 0>>
      <<set $empathy++>>
      <<set $totalPoints-->>
      <<replace "#empathyStat">><<print $empathy>><</replace>>
      <<replace "#pointsStat">><<print $totalPoints>><</replace>>
    <</if>>
<</link>>\
<<link "[-]">>
    <<if $empathy gt 0>>
      <<set $empathy-->>
      <<set $totalPoints++>>
      <<replace "#empathyStat">><<print $empathy>><</replace>>
      <<replace "#pointsStat">><<print $totalPoints>><</replace>>
    <</if>>
<</link>>
Intelligence: \
<<link "[+]">>
    <<if $totalPoints gt 0>>
      <<set $intelligence++>>
      <<set $totalPoints-->>
      <<replace "#intelligenceStat">><<print $intelligence>><</replace>>
      <<replace "#pointsStat">><<print $totalPoints>><</replace>>
    <</if>>
<</link>>\
<<link "[-]">>
    <<if $intelligence gt 0>>
      <<set $intelligence-->>
      <<set $totalPoints++>>
      <<replace "#intelligenceStat">><<print $intelligence>><</replace>>
      <<replace "#pointsStat">><<print $totalPoints>><</replace>>
    <</if>>
<</link>>
<<link "[Reset Points]">>
    <<set $empathy to 10>>
    <<set $intelligence to 10>>
    <<set $totalPoints to 5>>
    <<replace "#empathyStat">><<print $empathy>><</replace>>
    <<replace "#intelligenceStat">><<print $intelligence>><</replace>>
    <<replace "#pointsStat">><<print $totalPoints>><</replace>>
<</link>>

Empathy: <span id="empathyStat">10</span>
Intelligence: <span id="intelligenceStat">10</span>
Remaining Points: <span id="pointsStat">5</span>

[[Test Stats]]

:: StoryInit
<<set $empathy to 10>>
<<set $intelligence to 10>>
<<set $totalPoints to 5>>

:: Test Stats
<<linkreplace "Make an intelligence check?">>
    <<set _result to random(1, 6) + $intelligence >>
    <<if _result gte 15>>
    Intelligence Success! (_result >= 15)
    <<else>>
    Intelligence Failure! (_result < 15)
    <</if>>
<</linkreplace>>
<<linkreplace "Make an empathy check?">>
    <<set _result to random(1, 6) + $empathy >>
    <<if _result gte 15>>
    Emaphy Success! (_result >= 15)
    <<else>>
    Empathy Failure! (_result < 15)
    <</if>>
<</linkreplace>>

//Undo

:: StoryTitle
Programmatic Undo in SugarCube

:: Start
[[Enter the Darkness]]

:: Enter the Darkness
<<back "You are not ready! Go back!">>

//Creating Headers And Footers

//You have to create a Passage with name as showing down.

:: StoryTitle
SugarCube: Headers and Footers

:: Start
This is content between the header and the footer.


:: PassageHeader
This is the header!


:: PassageFooter
This is the footer!

I wanted to create a Header on all pages because I want the player to have access to his inventory at all times. and be able to go back and continue.

I have also added an If to check if the current passage is inventory, so that the inventory link does not appear in inventory….. Loop!

// AddItemsInventory

After a little research I finally found a way to add items to my inventory with a click! the command I used is <> that receives text, and you can add in half what you want to happen when the player clicks. In my case I have added it.

<<if $inventory.indexOf("Scissors") == -1>>
		<<link "There is a Scissors here. ">>
		<<addToInv "Scissors">>
                <<goto [[Scissor]]>>
		<</link>>
<<endif>>
<<set $pass to previous()>>
	<<if previous() is "izquierda">>
			<<if $bucle === 2>>
				[[Derecha]] 
			<<else>>
			<<set $bucle to $bucle + 1>>
				2 [[izquierda]] 
				vamos por el <<print $bucle>> paso

			<</if>>
	<<else>>
		1 [[izquierda]] 
	<</if>>

//RnG Choice

The moment Thinky leaves the house he has to decide whether or not to dodge! This attempt to dodge I have generated with the random() function, then check if X has come out, send it to a step and if it has generated another send it to another side.

The Code finally look like that:

<<nobr>>
	<<set _esquivar to random(2)>>
		<<if _esquivar is 0>> 
			<<set _out to "correr">>
			<<set _text to "Consiguio agacharse rapidapente y esquivarlo, el hombre tropezo, y se callo al suelo. Thinky aprovecho para ">>
		<<else>>
			<<set _out to "Continuar">>
			<<set _text to "Thinky intento exquivarlo como pudo, pero fue demasiado lento y fue empujado hacia la carretera. ">>
		<</if>>
		<</nobr>>
		Intentar 
                <<linkappend "esquivar. " t8n>>
                   <<print _text>> <<link _out>><<goto _out>><</link>>
		<</linkappend>>

//Funcion previous()

Using this function I’m giving dynamism to the story so that the character passing through the same places, have different events. But I have discovered a problem. And is that if you return with the macro <<back “back”>>, the function does not save anything.

So instead you have to use [[Back|”passage”]], using it so if you load the name.

Images

Main

//Links

// Twine Hosts

https://onezero.medium.com/this-brain-computer-uses-your-jugular-like-a-usb-cable-d02b4e76d26b?gi=785ef98789b

Music: Baclou [Full Length Dark Ambient Album], Moloch Conspiracy

https://www.newgrounds.com/audio/

Workshop 0004 Retro Game Challenge

// From Bomberman To Umai. ^^


I decided to make Bomberman, a game that reminds me of my childhood and was apparently easy to create with the naked eye.

But it turned out to be much more complex than I expected, collision mechanics that don’t work or can’t be done in arcade.makecode.

I felt very frustrated in not having anything solid finished, the basic mechanics of the game I could not create.

Since I didn’t know exactly how to get the exact collisions I used a way to trace my character’s position in real time.

I found on the internet that precisely in arcade.makecode there is a bug, where exactly was my problem. And apparently nobody has been able to solve it. The problem comes from the collision between Sprites(Projectiles) and Tales(Wall). When a Sprite is emitted from the player position, if the player is near Tale(wall), the projectile is not generated. Although the Wall Function is Off.

https://github.com/microsoft/pxt-arcade/issues/1104

Why is this a problem?
Because bomberman has to put bombs close to the walls to break them. but when put close they are not generated.

Another problem I found was how to edit the walls when the explosion touches them.

BreakingNews!

After hours and hours of trying to put the game mechanics to work I have to say that I have surrendered… but here we welcome Umai. A small and intrepid adventurer with a mission!

I created a simple game, in which I distribute the objects through several loops depending on the colors of the Tile map, I have achieved that the player can not jump eternally putting a “If Sprite = Not in wall“, to code because it did not allow me the puzzle.

The function that I have taught the most time I could say that it is “to kill and not be killed” by the puppies.

Simple if to dont permit our character fly.

After all this I think I’ll start to understand better how maps and characters are generated in a game in a more automated way thanks to Loops and Arrays, this way I can generate many different maps with the same material.

And thas also to kill the player if go down the holes in the map, And the Win condition.

Conclusion

As a lesson from this work I have come to the conclusion that not everything is as easy as it seems. And it takes a lot of time and clarity to create a game in a decent and effective way. Sometimes it’s better to change your objective if you’re not solving it than to frustrate yourself in something that will cost you too much time and energy. Equally everything is learned. And I take with me many constructions of learned mechanics.

Starting With MicroBit

What its Microbit?

Microbit is an intermediate programming language that helps to develop Java through Blocks. And experiment with the device both virtually and physically.

Cach the ball

Today we have been doing different tutorials, to better understand how programming languages work at a more basic level.

Simple Animation

Researching with my partner we saw that there was also the possibility of programming with python. https://python.microbit.org/

But nothing here about Blocks, Just Coding and Export.

But if I have seen that there is much more documentation in some aspects

Stay On!(Balance) MicroBit

After doing several tutorials and a little curiosity how this small machine worked. I decided to try to make a game on my own using only the Acelorometer as Input.

The Game mechanics its simple

  1. If Player stay on the mid Led, you add Point To your Score.
  2. If Player stay arround but not in walls nothing happens. (still alive).
  3. If Player collision with walls lose Lives.

Getting Started

I’ve started initializing my variables. Score to 0 which is the player’s initial score, I set the position of the Sprite to X:2 Y:3. I have decided to put it in this position and not in the middle so that the player does not start picking up points and has to move from the beginning.

Index

And to finish the beginning of the game I set the Game variable as true and the Equilibrium variable to 10 that count how many time the sprite colision with walls.

Now let’s go with the Block forever. I’ve decided to put it all inside a While.
That later I will talk about how to balance the rest of the points.
So in the While, I create a Variable called XMov, to move my sprite by X and call the acceleration input (mg) of X.

Reading the Documentation I saw that this input (acceleration (mg)) returns a range of +/-2000.

Then I check if XMov is -50, if it is the case I change the direction of Sprite from X to -1 and so I get the sprite to move to the left.
and pause so the game doesn’t go so fast.

I repeat the same previous action but this time I check if it is over 50 and change X sprite by 1 to go to the right. I decided to put 50 because if I put it lower the sensivity was too high and could not be controlled.

We also repeated the same action for Y.

Move sprite on X
Move Sprite on Y

And now that we have the movement of the sprite we will check when we want to increase the score or remove balance. I have done it with Several if. the First check if the Sprite is in the coordinates 2.2. If so, add Score, Score +3 (I like the number 3) and put a happy Sprite.

If not, I paused the game a little bit so that the player if he leaves the wall quickly does not lose life. And then I check if Sprite is at X=0, or Y=4, or X=4 or Y=0. If any of the above if true it means that the sprite is touching the wall therefore to the balance variable the rest -1, and I put the fail icon.

If equilibrium reaches 0 it exits While, erases the screen, and then shows the string “Score” and the Variable Score.

Reset Game

ahh I also set the A+B entry to Reset the game.

This would be the beginning, after here you could add more levels of difficulty the longer you are without dying. changing the sensivity.

My first contact with something more structured made in microbit, has been a small challenge, I have encountered difficulties in how to manage the walls but in the end I managed to make it work after several tests and calibrations.