Reprinted for study.
Last time, I introduced how to place characters and items on the stage using the new RPG kit.
This time, I will introduce how to strengthen the slime placed on the stage.
First, put the slime on the stage with the + button
I tried setting it to the background of "Togijo" from the button to change the map1
Modify slime to make it stronger
Please pay attention to the upper left of the screen where the program is written
In this column, icons of things placed on the stage are lined up.
There are only the player and the slime in the game right now, so there are only these two icons.
Now let's click the blue slime icon on the right
Then ... the program written on the screen changed
Here is a blue slime
- Set HP to 3 when created in-game
- Always repeat attack → wait
- Creates (drops) a green gem when knocked down
And so on... A program about blue slime is written
I read this program as blue slime modification code
This operation goes from the code about the stage to the modding code for the blue slime.
It is an image that switches the file to be edited
Let's increase the physical strength of the slime
Physical strength is written around line 8
this.n('たいりょく', ('▼ を', 'イコール'), 3) // 体力をきめる
is determined by the code
Now, let's rewrite the written numbers
3
to10
Don't forget to press the play button on the upper right after rewriting
Then...
Slime is a little stronger now
Let's decide the skill of the slime
Next, let's insert a line to set the skill in the blue slime's modification code so that the slime can shoot magic.
To insert the program that sets the skill, first press the + button
Then the list of characters will be displayed first , select the skill category and press the red whirlpool
You can select where in the program to insert the code that sets the skill from the button that says select by clicking ▼ .
Let's choose when it was created this time
After that, when you press + put on stage ...
A magical whirlpool attacks the player!
When was it made?
Part of the program after inserting the code to set the red whirlpool to the skill
This means that when a blue slime is created in the game, the code written between
{
the parenthesis on line 5 and the parenthesis on line 14 }
will be executed line by line.Therefore, the code written at the time of creation often determines the initial settings of the character.
Besides this
- Always ... Repeat the written code and run it over and over
- When knocked down ... Execute the written code when the character's HP reaches 0
And so on
What are skills anyway?
The code for the skill we just added is inserted around line 13
this.skill = '赤色のうず' // 自分のスキルをかえる
This code determines what the character puts when attacking. is. For example this
this.skill = 'ばくだん'
, every time the slime attacks, it will place a bomb in front of it.
Let's change the movement of the slime
The code for the movement is always written inside around lines 16-21
This is because the blue slime always
- attack
- wait (1 second)
represents a repetition of
So let's insert a line of code here to chase the player
+ button → move category → please select
Click to select ▼ button → select always → + put on stage button You can insert it by pressing
Then...
This is a formidable enemy...!
By the way, my program always looked like this:
Line 22
await this.chase4('プレイヤー') // おいかける
is the inserted codeWhat happens if you place multiple blue slimes?
Press the icon of the house mark on the upper left of the screen where the program is written
Then you can go back to the original program where you put things and characters on the stage
Now, place the second blue slime from the + button.
The number of powerful enemy slimes has increased to 2!?
This way the mod code change will be applied to all blue slimes in the game
But I wonder if there are more than 2... can't you erase the slime?
To remove the slime we just added, delete the one line of code that makes the slime
rule.つくる('青色のスライム', 1, 4, 'map1', ('▼ むき', Dir.ひだり))
it 's around line 141, 4,
Click somewhere (e.g. around or where there is no button)Then, a button to copy one line and delete one line is displayed under the 14th line .
Let's delete the selected line with the erase line button and update the game with the play button
One-on-one!
try to modify the player
For that, let's first go to the player mod code
Change player appearance (skin)
After that, please see the category by clicking the + button
From the Appearance category, you can insert code that allows you to change your appearance
This time, I will insert it when the skin Yusha Woman is created
There are other skins such as red slime, and it's fun even if you become a slime.
Change to your favorite character
make the player stronger
Let's make the player strong like a blue slime.
This time, the author is the player's "when created"
- Change physical strength (HP) to 10
- Insert code to beam skill
- Insert the code that sets the speed to 3 in the strength category
and made the change
Speed to toy with slime!
Complete!
The game is now complete! ...... I thought, but actually this game, there is no game clear as it is
It is necessary to insert a program that clears the game at an appropriate location
This time , let's insert it when the blue slime hits the betta
Game clear is in the system category
Hack.gameclear() // ゲームクリア
will insert the code
0 コメント:
コメントを投稿