Tuesday 26 May 2015

Today is the day we learn about Outputing symbols k. And I might put a little bit of if statements in or just make it move actually yea.

So to get started start a new Program

On the First line we are going to do Variables and these are really helpful.

So there are to positions to a output. The X and the Y. The Y always comes first in this language but usually the X dose. So to star a variable you ave to have a number.Always start with the Y position. So you write a number between 1-8. Then you have to store it. So the Store button is 1 to the left of the 1 key, then write Y. Do the same with the X variable on the next line.

After that on the next line create and Lbl and name it G.

Then on the next line Clrhome(PRGM,Right arrow,8)

Now on the next line is how to Output a symbol. Press PRGM and then right arrow and then 6. Now I told you about how Y come before X. So you have to write Y,(comma) X,(comma) "(a symbol)"

Should look like this: Output(Y,X,"a symbol"

Okay.

Now to make it move.

You have to use If Statements. If statements are used for checking if a key is pressed or if something is touching something or if it is of the screen. There wonderful.

But first you have to use the GetKey command. So on the next line press PRGM then Right arrow then 7.Then Press the store button and then name it K.

Should look like this: Getkey--> K

Okay.

Now the if statements.

Write this.

:If K=24:Then
::X-1(Store button) X
:End

:If K=26:Then
::X+1(Store Button)X
:End

:If K=25:Then
::Y-1(store button)Y
:End

:If K=34:Then
:Y+1(Store button)Y
:End

Goto G

Now it can move around the screen. All the Commands like Then and IF and End are there is you press PRGM and scroll down. I will explain how this works tomorrow. But is should make your symbol move.

Your code should look like the above but above the If statements should be.

:(some number between 1,8)(store button)Y
:(Some number between 1-16)(Store Button)X
:Lbl G
:Output(Y,X,"Some Symbol"
The If statments
:Goto G

Thanks


Seth

No comments:

Post a Comment