How to learn basic values

hopscotch
help
helpwithcode

#1

Hi, I'm @Petrichor.

I am going to teach you some cool things to do with values.

Values are numbers you can change in projects using these blocks:

Now, I will show you the default values and what they do.

Default Values

Default Values

Both characters and the device have values. Default values are changed by thing in game, not blocks.


Those are the device's default values.

Width

Width is the width of the screen. In landscape, it is 1024, and in portrait it is 768.

Height

Height is the height of the screen. In landscape it is 768 and in portrait, 1024.
Useful for making backgrounds

Tilt up %

This is how tilted up the iPad is.

Tilt down %

This is how tilted down the iPad is.

Tilt left %

This is how tilted left the iPad is.
This is good for making driving games.

Tilt right %

This is how tilted right the iPad is.
Good for making driving games

Last touch X

This is the location of the last touch on X.
Essential to drawing tools

Last touch Y

This is the location of the last touch on Y
Essential to drawing tools

So that's all the default iPad values, but characters have them too.

Rotation

This is the object's angle from the bottom of device in degrees. Edited by the set angle and turn blocks.
Clones have this to themselves

X Position

This is the object's Location on X, edited by move forward, change X, and set position blocks.
Useful for making backgrounds
Clones have this to themselves

Y Position

This is the object's Location on Y, edited by move forward, change Y, and set position blocks.
Clones have this to themselves

Invisibility as a %

The object's invisibility, edited by the set invisibility block.
Clones have this to themselves

Size as a %

The object's size, edited by the set size, grow by, and shrink by blocks.
Clones have this to themselves

Speed

The object's speed, edited by set speed blocks.
Doesn't effect set position
Clones have this to themselves

You may have noticed a new value button. This creates values.

Creating values

Creating values

1.

Select any object, or even the device to make a value.

2.

Tap "new value"

3.

Name your value.

Values you created can be changed by any value block, no matter what. Let's look at the value blocks again:

I will now teach you set value:

Set Value

Set Value

With set value, you can set any value (besides the default ones) to whatever you like. The first bubble is for the value being set. The second is for what it's being set to. A number, a math problem, even another value!

Set value can be used for high scores, levels, even websites and iPads! (Although the last two are easier thanks to the new "when" blocks)

Setting values to other values

Setting values to other values works like this: it gets set to the second value at the time of the set value block. Example:


You may think 1 will = 1, but because 2 hasn't changed yet, it'll = 0.

Ah! Now that you have a basic understanding of set value, we will learn the next value block!
Let's see what it is:

Oh, increase value! You'll love this if you're into making timer based games, scores, and more!

Increase Value

Increase value is simple and useful, once you understand it.

Bringing values up

To bring a value up, put the value you wish to increase in the first bubble, and what you are adding to it in the second. Using values for two bubbles is very similar to set value.

Bringing down a value

To bring down a value, simply use a negative number.

That's it!

I hope you enjoyed and learned a valuable lesson. I spent a while on this and it's my second "how to" this week.

I have more "how to"s
Make a Shop
Make "And" "Or" "When Blocks"
"Clean up" Code
Basic Values
Bold Text


Exchanging opinions about our games
Hi I am new here! :D
The tutorial collab (no more spots left!)
I'm new and I need help with code
How do i make an art pad?
The Newbies Guide to Hopscotch
ICMLC ICMLC ICMLC, is cool
How to do Bold Text
#2

This is a great tutorial! :stuck_out_tongue_winking_eye:
Especially for new hopscotchers!!


#3

Wow, this actually helped me out!
:D.


#4

Great!


#5

Amazing tutorial @Themasterofairjitzu!! Great job explaining everything! I like how you included lots of screenshots for visual learners. The [details] drop down menus are useful, too, so you don't get too overwhelmed when reading everything and can read certain concepts in chunks. :smiley:


#6

this is sooo useful thank you for making this!!! i learned a lot :smile::smiley:


#7

Great tutorial! :thumbsup:


#8

This is a really good tutorial!! :thumbsup:


#9

Really helpful for new hopscothers. Easy to understand! :thumbsup:


#10

Thanks!


#11

Great starter topic! Here is a like :heart:
U should post this in @JojoDude's newbie topic!
Link:
http://forum.gethopscotch.com/t/the-newbies-guide-to-hopscotch/27169


#12

Ok! I put the whole list there.


#13

On the reply??! @Themasterofairjitzu


#14

No. I did not. Haha. No list. It's up in post uni

@Paige1212


#15

I like da button!
It goes to Mai profile!


#16

This is a good tutorial, very clean, congratulations and thanks for sharing your knowledge!