Lecture: 14 | WATER BOAT GAME IN SCRATCH | GAME DEVELOPMENT | SCRATCH TUTORIAL
Summary
TLDRThis tutorial video guides viewers on creating a boat water game in Scratch 3.0. It covers setting up the stage, adding backdrops, and creating variables like score. The video demonstrates how to animate sprites, such as rocks and speed lines, and includes coding for game mechanics like spawning, movement, and collision detection. It also details the boat's controls and game over conditions, concluding with playing the game in full screen mode.
Takeaways
- 🚀 The video is a tutorial on creating a boat water game in Scratch 3.0.
- 🔍 It starts with removing the default cat sprite and choosing a blue sky backdrop for the stage.
- 🎨 The creator adds a second backdrop for the game mode, which is a red color-filled stage.
- 📝 A 'score' variable is introduced to keep track of the game's progress.
- ⏱ The score increases by one every second in a loop, starting from zero when the game begins.
- 🏞️ Border sprites are added and programmed to move to the center of the stage and stay on a back layer.
- 🗿 Rock sprites are created, cloned, and made to move downwards from a random y-position at the top of the screen.
- 🌊 Additional sprites representing water waves or speed lines are created by duplicating and modifying the rock sprite's costume.
- 🛶 A board sprite is added with multiple costumes representing different orientations of the boat.
- ⛔ The game ends by switching to a 'game over' backdrop if the boat touches rocks or borders, with movement controls tied to arrow keys.
- 🔄 The boat sprite changes costumes and moves in response to left and right arrow key presses, with a check to ensure it moves in the correct direction.
Q & A
What is the main topic of the video?
-The main topic of the video is to demonstrate how to create a boat water game in Scratch 3.0.
Why does the video start with removing the default cat sprite?
-The video starts with removing the default cat sprite because it is not needed for the boat water game project being demonstrated.
What backdrop does the video suggest to choose for the game?
-The video suggests choosing a blue sky backdrop for the game.
How many backdrops are created in the video for the project?
-Two backdrops are created in the video for the project: one is a blue sky and the other is a game over screen colored red.
What is the purpose of the 'score' variable in the game?
-The 'score' variable is used to keep track of the player's score in the game, which increases every second.
How does the video describe creating border lines for the game?
-The video describes creating border lines by using the 'paint' option to draw rectangles, filling them with green color, and then duplicating and positioning them on the stage.
What sprite is used to represent rocks in the game?
-The video uses a rock sprite found in the Scratch library, resized to 50% of its original size.
How does the rock sprite move in the game?
-The rock sprite moves by creating clones that appear at random positions at the top of the screen and then move downwards.
What is the purpose of the 'speed lines' sprite in the game?
-The 'speed lines' sprite is used to create the illusion of movement or waves in the water for the boat to navigate through.
How does the video handle the boat sprite's interaction with rocks and borders?
-The video uses 'if' statements to check if the boat sprite touches rocks or borders, and if so, it changes the backdrop to 'game over' and stops the game.
What keyboard inputs are used to control the boat sprite's movement?
-The right and left arrow keys are used to control the boat sprite's movement, with the right arrow moving it to the right and the left arrow moving it to the left.
How does the video ensure the boat sprite moves smoothly on the screen?
-The video ensures smooth movement by using 'if else' statements to switch costumes and move the sprite in steps when the arrow keys are pressed.
What happens when the boat sprite reaches the bottom of the screen?
-When the boat sprite reaches the bottom of the screen, it is programmed to delete the clone and return to the top, creating a continuous movement effect.
How does the video encourage viewers to engage with the content?
-The video encourages viewers to subscribe to the channel, like the video, and watch more informative videos for further learning.
Outlines
🚀 Introduction to Creating a Boat Water Game in Scratch 3.0
The video begins with an introduction to creating a boat water game using Scratch 3.0. The presenter removes the default cat sprite and selects a blue sky backdrop. They then create a second backdrop for the game mode, changing its color to red. A variable for the score is added, and the presenter explains how to set the score to zero when the flag is clicked and increment it every second. The addition of border sprites as game elements is also covered, including creating and positioning them on the stage.
🌊 Developing Rock Sprites and Movement Mechanics
In this section, the script describes the process of adding and coding rock sprites to move across the screen. The presenter explains how to create clones of the rock sprite that appear at random positions at the top of the screen and move downwards. They detail the use of comparison operators to delete the clone when it reaches a certain y-position, simulating the rock moving out of the screen. The presenter also demonstrates testing the code to ensure the rocks move and clone as expected.
🏞️ Adding Water Waves and Speed Lines for Visual Effects
The presenter moves on to enhance the game's visual appeal by adding water waves or speed lines. They duplicate the rock sprite and rename it to 'speed lines,' then change its costume to create a wavy pattern. The process of drawing and positioning these lines on the screen is explained. The script also covers how to make these speed lines move across the screen in different positions to simulate water movement, and the presenter runs the game to show the visual effect in action.
⛵️ Implementing the Board Sprite and Control Mechanics
The final part of the script focuses on adding a board sprite and coding its behavior. The presenter uploads different costumes for the board and adds code to switch between them based on user input. They explain how to make the board move to the front layer, position it centrally, and check for collisions with rocks or borders, which trigger a game over state. The movement of the board is controlled by the keyboard's arrow keys, with the right arrow moving the board right and the left arrow moving it left. The presenter concludes by testing the full-screen mode of the game, showcasing the board's smooth movement and collision detection.
Mindmap
Keywords
💡Scratch 3.0
💡Code Area
💡Sprite
💡Backdrop
💡Variable
💡Event Block
💡Forever Block
💡Clone
💡Border
💡Costume
💡Control Block
💡Layer
💡Game Over
Highlights
Introduction of a tutorial on creating a boat water game in Scratch 3.0.
Removing the default cat sprite from the project.
Adding a blue sky backdrop to set the scene.
Creating a game mode backdrop with a red color.
Duplicating and renaming the backdrop for different game stages.
Introducing a score variable for the game.
Setting the initial score to zero when the game starts.
Incrementing the score every second with a forever block.
Adding border sprites to define the game area.
Creating and positioning border lines using the paint editor.
Coding the border sprite to move to the center of the stage.
Adding a rock sprite and setting its movement path.
Creating clones of the rock sprite to add challenge.
Coding the rock sprite to move downwards and delete clones upon reaching the bottom.
Introducing speed lines to enhance the game's visual effects.
Customizing the speed lines costume with random lines for a dynamic look.
Adding a board sprite and coding its movement based on keyboard inputs.
Implementing collision detection between the boat and obstacles to end the game.
Finalizing the game setup with full screen mode for an immersive experience.
Encouraging viewers to subscribe and like for more informative content.
Transcripts
[Music]
in this video i will show you how to
make a boat water game in scratch 3.0
so let's start this is my code this is
my
code area this is my stage and i don't
need the sprite so i will remove this uh
cat sprite so just remove it okay good
now i have to add my backdrop so click
choose a backdrop
and i am choosing a blue sky backdrop so
i am clicking on it
okay good now just click on back uh
backdrop tape
and remove this backdrop one and i am
choosing
i am filling this color just check this
and click on this paint and color it
okay now i am right click on it and
duplicate it
so i will rename it as a game or i need
to backdrop for my project
one is blue sky and another is game mode
so i will here i will type
game or select all
and make it a color red now increase its
size
that's great okay now i have
created two backdrops for my project now
for
my backdrop i will add some code so for
this
i need a variable a score for my project
so click
on variables and click on my make a
variable
and here i will rename as a score
okay good click enter so i have added my
score into my project
so click on this backdrop and here i
will add some code for my score block
score option so just click on events
and click on this when flag clicked
so initially when i click on flag so the
score will be zero so set my score to
zero now foreverly the score will be
increasing
after one second one by one so for this
i will choose a forever block
and in this i will choose i change score
by one
and after one second
waits one second so when i click on flag
so it will change score one by one sorry
uh click on this change score by one now
when i click on flag
so it will changing score one by one
okay good
now i'm adding another uh sprite
so my another sprite will be border
lines
into my this project so for this i will
need a create
a paint choose a sprite and click on
paint option so here i will add some two
borders
into my project one here and another one
is
dual so for this i will choose click on
this rectangle option
just click on this and click this fill
option
that is uh green
okay good so it will be my
and the size will this for me that is it
sorry two okay
now i am filling it just right click and
drag this okay good
now same to same copied it
just copied it okay good and now paste
it
that's great now just put this into
this in this position that's great
so okay good so for this uh
option that is sprite i will rename it
this is
that is border so these are the border
for my
project now click on code
so click on code just whenever i click
flag has been clicked so this position
will be at the center
at the center of my stage so for this
i will just add this block that is go to
x0 y0 so just click on flag
so you can see this this border are in
the accurate position
now these are on the front so we have to
go back to one layer so just
there's an option that is go back
back layer okay great now we have to add
our
next sprite that is rock so just click
on this to sprite
and here i will search a rock sprite
that is click on it now we have to
resize it just click on this size option
and we have to reduce your size to 50
that's great now we have to add some
block for our rox code
so it will move from this position into
this direction
so for this we have to click on events
and
we have to uh make different copies of
this sprite so for this we need to hide
this
original sprite and we have to make or
clones of this uh object that is
rock sprite so we have to create clone
of my cell
after every one second so after every
one second it will create this clone
when whenever clone has been created now
we have to
do when i start as a clone that is we
have to go to back one layer
so just click this go to back one layer
that's great now we have to show this
copy show this clone
and it will go to the random position
it will come from this position or from
this position or from this position
and we have to set its y position it
will come from this top of this position
so we have to set the y position
into 180 so
we have set the position 180 now we have
to set the x position
say so it will come from this random
direction now
from uh the random position for this
x position will be uh from
minus 190 to 190 that's great
now we have to submit some another code
for our project that is
foreverly it will come from this up
direction to lower direction so it will
change its
y position so we have to click this
write this block and we have to change
this by
minus eight now if for
the condition we will apply a condition
for this so we
whenever uh this rock uh reach this
position it will
delete this clone so for this we have to
add some comparison operators
so there is an operator that is right
this less than blocked
and in this option we have to drag this
y position
and we have today minus 170
that's great now whenever this rock
reaches to this position so it will
delete this clone
so just click on controls and click
delete this clone
now we have to try our codes so
let's uh run it that's great
so now it's coming from randomly
position and it's creating its clone
that's great
now we have to make uh another sprites
it will be like water waves or speeding
lines
so for this we don't need a duplicate of
this
rock side so just right click on it and
make a duplicate
so great so i have created a rocks so it
uh duplicate now just rename it to speed
lines
speed lines and we have to change its uh
costume so just click on the speed lines
and click on this costume steps
that's great now we have to change its
costume
we have to make some random lines or for
our
costume speed lines so just click on
this and remove
and click on this delete option so we
have removed this
let's create now we have to draw some
lines just like a speed lines
so it will like split line two
and that's where and it's called we have
to
write this white color okay and we have
to change its
position that is outline two and
raw we have to draw some lines that's
great
if you want to zoom it so you can zoom
it here from this position
and if you want to duplicate it just
copy
it and paste it that's great so
we have added some lines
into the center position that's great
now we have to click on this flag so it
will come into different positions
you can see it here that's great you can
also make the duplicate again
so just click on this copy and
you can paste it here again so that's
great
now you have to run this okay great
that's great now we have to add our
board sprite in this
board sprite we have to do some code so
uh
the board sprite uh in the bose
courtroom are
present in this below description you
can choose it from
the below description okay so we have to
choose a board scribe from our
gallery that is upload upload option
upload sprite
so we have to click on uh upload sprite
that is
up that is great
so the up costume had been added now we
have to add another costume for our
uh board sprite so just click on this
upload costume
and we have to upload this left uh
costumes
and we can also upload this its right
costume you can also download this
costumes from my
below description link okay
so these three costumes have been added
now we have to add some code for this
costume that is
and we have to rename this uh rename
this costume
that is boot that's great
okay good now you have to click on this
board and click on this code tab
now now we have to add some code for
what uh
what of sprites so whenever the flag has
been clicked
that's great now we have to add some
code for
both so switch back drop we have to this
is our uh
switchback drop to a blue sky so
whenever we click the black
blue square drop has been up now we have
to switch the costume
switch costume to up so whenever we
click so it's cartoon will be in this
direction
now we have to add some go to front
layer
so just click this to go to front layer
that's great
now we have to make in the center
position
so we have to specify its position like
in this position
so just click this go to x and y
position now great
now we have to apply a check that is
forever lee
foreverly we have to check
we have to check what if this boat
touches this
rocks or this border so it will change
its costume to uh
backdrop to the game or and the game
will be stopped so for this we have to
add an operator that is our block
if this boat touches border or rock
so we have to click on sensing if this
boat touches touches water
or touches
that is what touches rock so
we have to switch the backdrop to game
war
switch back drop to game over and it
will stop all the game
so just stop on that's great
now we have to add some movement for our
board sprite whenever we press the
keyboard right arrow
so it will move into the right direction
whenever we
we press the left arrow so it will move
into the left direction for this we have
to
add another when flag block and we have
to add another
forever block and we have to eat if else
block for our
moment so that's great whenever
the key space pressed whenever the right
arrow pressed
so it will change the costume
switch costume to right so it will the
right costume will be
appear and move five steps
whenever we change the or press the
right arrow so it will move into five
steps and it will change the costume
otherwise it will be in the original
costume that is up
up costume that's great now we have to
add another uh
condition that is whenever we press left
arrow
so for this we have to apply if
condition
and whenever the left arrow pressed
the left arrow press so switch cost two
two
switch costume to left and move into
minus five steps so it will move into
minus five steps
so that's great
okay we have to just change this left
arrow so
whenever the left arrow has been placed
so just left
so now we have to try it so that's great
so it's moving okay now we have to play
into the full screen mode
that's great you can see it here
it's moving like a rock and whenever it
touches the border
so it will come back to this position
and whenever it's run to
flag so that's great you can see it here
it's moving like smooth direction
whenever it's
moving to this that's great so if this
video helped you please do subscribe
our channel and please like our video
for more informative videos please do
subscribe
thanks for liking
Voir Plus de Vidéos Connexes
Beginners Guide To Scratch (VERY Simple)
How To Make a Topdown RPG in Godot 4: Adding Classes and Projectiles (Part 5)
Collision Detection - How to Make a 2D Game in Java #6
How To Make a Topdown RPG in Godot 4: Adding Combo Attacks and an Enemy(Part 2)
How To Make a Topdown RPG in Godot 4: Adding The Player (Part 1)
Juiced Up First Person Character Controller Tutorial - Godot 3D FPS
5.0 / 5 (0 votes)