This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-18 15:14:59

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Varibles X and Y

I noticed that some projects had varibles X and Y. I found them in alone 2 and aftermath. People never responesed to me and it got on my nerves because I wanted to make a project that was like it.

-EDIT- Fluffy Llamas!!!!

Last edited by gooeygoo (2012-08-21 19:11:50)


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#2 2012-08-18 15:30:42

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Varibles X and Y

It'd either be x velocity and y velocity or x and y scrolling. velocities are just to make movement smooth and scrolling is when the background moves around you


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-08-18 15:42:47

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

But it's NOT scrolling. play this, then tell me what scripts I should use http://scratch.mit.edu/projects/Wes64/2701250

Last edited by gooeygoo (2012-08-18 15:44:03)


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#4 2012-08-18 15:56:33

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Varibles X and Y

gooeygoo wrote:

So if this does not get a response, then I would think scratch does not care about me. So don't ignore this post.

Seems a little whiny, don't you think? Especially considering Scratch is a programming language with no thought, emotion, or mind, and the community is helping you out here. Not Scratch. The Scratch Community. And it's completely self-centered to think that if no one responds within a couple minutes that everyone hates you, and doesn't care about you.

Anyways, that's velocities. They are used to make smoother movement. You can find out a basic velocity script, and more on the Scratch Wiki page for it.

Last edited by henley (2012-08-18 15:57:05)


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#5 2012-08-18 16:18:39

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

I meant the background, how does it change when you hit a edge, not velocites!!!


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#6 2012-08-18 16:28:17

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Varibles X and Y

gooeygoo wrote:

I meant the background, how does it change when you hit a edge, not velocites!!!

Jeez, I was just helping. Besides that kind of scrolling, and yes, that is considered a type of scrolling, has nothing to do with the Y and X variables you said you wanted to build a project with.

You're so unthankful and rude, that I'm not going to help you anymore.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#7 2012-08-18 16:34:05

soniku3
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Varibles X and Y

henley wrote:

gooeygoo wrote:

I meant the background, how does it change when you hit a edge, not velocites!!!

Jeez, I was just helping. Besides that kind of scrolling, and yes, that is considered a type of scrolling, has nothing to do with the Y and X variables you said you wanted to build a project with.

You're so unthankful and rude, that I'm not going to help you anymore.

I should have do that too!


internet's all about cats today.

Offline

 

#8 2012-08-18 16:42:09

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Varibles X and Y

Reading this, I was going to help, but never mind, I don't help whiners.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#9 2012-08-18 18:09:37

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Varibles X and Y

I'd usually agree with firedrake, henley and snoiku, but since it's a simple matter I'll briefly go over it. You basically check the players y position against 180 or -180 depending on what direction you want it to go, then if it's equal/greater than you change background, and use a variable to choose what checking set to use


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#10 2012-08-18 19:20:51

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

Well, sorry, I was kind of annoyed because I didn't know what you meant. And I really should have been nicer when I first started this, so, can you please show me how I do it, and I'll try not to whine? I REALLY WILL, AGREED  big_smile


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#11 2012-08-18 20:29:26

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Varibles X and Y

gooeygoo wrote:

Well, sorry, I was kind of annoyed because I didn't know what you meant. And I really should have been nicer when I first started this, so, can you please show me how I do it, and I'll try not to whine? I REALLY WILL, AGREED  big_smile

I just explained it, use the < and > blocks with the sprites y position in one and the barrier height in the other, then change the background and move the sprite to the opposite end of the screen


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#12 2012-08-19 10:31:34

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

I meant a script like

                             when gf clicked
                             Something
                             Like
                             This
                             


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#13 2012-08-19 16:41:42

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Varibles X and Y

I think people may be struggling to understand what you're requesting help for. Couldn't you use:

when gf clicked
forever 
if <touching [edge v]?>
if <(x position) < (0)>
broadcast [previous background v]
else
broadcast [next background v]
end 
end

when I receive [previous background v]
switch to background ((background #) - (1))

when I receive [next background v]
next background

Last edited by Prestige (2012-08-19 16:42:12)


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#14 2012-08-20 19:20:55

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

What about y? It's a x and y game. Will that work? i want to go down and up, not just left and right.
anyway, thanks for that help.


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#15 2012-08-20 20:17:23

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Varibles X and Y

have a second broadcast, and have that broadcast change thecostume by the width, and arrange your costumes like this:
costume 5 costume 6 costume 7 costume 8
costume 1 costume 2 costume 3 costume 4


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#16 2012-08-20 20:31:48

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

I meant in scratch blocks. can you please use scratch blocks, as the last time you did this, I had no clue what you meant.


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#17 2012-08-20 20:33:10

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Varibles X and Y

Sigh...

You really need a step-by-step walkthrough?  Can you try and figure it out?


http://i47.tinypic.com/2iaa73k.png

Offline

 

#18 2012-08-20 22:47:34

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Varibles X and Y

gooeygoo wrote:

I meant in scratch blocks. can you please use scratch blocks, as the last time you did this, I had no clue what you meant.

I'm not writing in scratchblocks because I can't be bothered to make sure all the brackets are in the right place. It's a fairly simple instruction, if you can't understand it writing the game would be even harder


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#19 2012-08-21 09:17:02

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

berberberber wrote:

Sigh...

You really need a step-by-step walkthrough?  Can you try and figure it out?

Well, I tried, but for some reason, one of the backgrounds was skipped when I went to one place.


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#20 2012-08-21 09:27:05

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Varibles X and Y

gooeygoo wrote:

But it's NOT scrolling. play this, then tell me what scripts I should use http://scratch.mit.edu/projects/Wes64/2701250

Why are you so interested in a script if you don't even know what it does?

Anyway, in that game, it's velocities. We have an excellent wiki article that you might want to check out.  smile


http://i50.tinypic.com/312u714.jpg

Offline

 

#21 2012-08-21 12:43:04

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

But I already took a sprite that has velocities. what does velocities have anything to do with it anyway?


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#22 2012-08-21 13:21:47

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Varibles X and Y

gooeygoo wrote:

But I already took a sprite that has velocities. what does velocities have anything to do with it anyway?

It makes the player move smoothly...


http://i50.tinypic.com/312u714.jpg

Offline

 

#23 2012-08-21 13:25:34

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Varibles X and Y

its my project! why are you asking other people to explain it... shoudnt you just have asked, well, me


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#24 2012-08-21 14:03:16

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Varibles X and Y

The x y velocity variables control movement, makes it look smooth, and can be used to generate gravity or momentum. But background changing doesn't really have much to do with those variables. For back grounds, make a field, such as this one,

when gf clicked
forever
if < ([background # v] of [Stage v]) = [10] >
if <<<< (x position) > [240]> and < (y position)> [100]>> and <  (y position) < [160]>>
switch to background [random background v]
else
if <<<< (x position) > [240]> and < (y position)> [-160]>> and <  (y position) < [-100]>>
switch to background [random background 2 v]
end
end
end
This will give you a high route, and a low route.

Last edited by sonicfan12p (2012-08-21 14:11:51)


Why are the secret organizations getting all the attention?  mad

Offline

 

#25 2012-08-21 17:13:19

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Re: Varibles X and Y

Ok, I think I have the hang of it, but I need help, Theres some glitch that when you move to background 2, you sometimes get stuck in the ground


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

Board footer