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

#26 2009-11-18 04:38:28

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

I don't understand... I deleted the scripts for the player, but the scroll sprite still disappears when I press green flag  sad
And I've made the scroll sprite real big, but how Do I actually get the background to move?

Oh, it's that he disappears? You said that he won't move.

To stop him disappearing, keep track of when he receives broadcasts on when the game begins and such. When it does, he should show; and only make him hide when he shouldn't be: e.g., at the beginning of the game.

Maybe I should try posting Scratch blocks? I'll try and type my own.

For jumping:

When Up Arrow Key pressed
repeat 6
change y by 8

When Green Flag Clicked
forever
   if not color [feet color] touching color [platform coating color]
   change y by -2

Or something like that. Change the proportions as neccessary.

For the scrolling:

When Right Arrow Key pressed
change ScrollX by -5

When Left Arrow Key pressed
change ScrollX by 5

You can also change the proportions to fit the scrolling speed.


Is that helping?


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#27 2009-11-19 00:55:32

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

sad  Just doesn't wanna work for me.
For the scrolling sprites script I have:
When Right Arrow Pressed
change ScrollX by -5

When Left Arrow Pressed
change ScrollX by 5

I have the same scripts in stage as well. (they are the only scripts for the scroll script and stage.

For my main character to jump I have:
When Up Arrow Pressed
If background# of stage = 1 or background# of stage=2(addin all of no's of stage as i go)
if touching colour blue or touching colour green
repeat 10
change y by 9

and also

When uparrow pressed
forever
reapeat until colour grey is touching colour green or grey is touching colour blue
change y by -2


that is all my scripts. When I press right or left my scroll script doesnt do anything

Offline

 

#28 2009-11-19 03:36:54

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

sad  Just doesn't wanna work for me.
For the scrolling sprites script I have:
When Right Arrow Pressed
change ScrollX by -5

When Left Arrow Pressed
change ScrollX by 5

I have the same scripts in stage as well. (they are the only scripts for the scroll script and stage.

For my main character to jump I have:
When Up Arrow Pressed
If background# of stage = 1 or background# of stage=2(addin all of no's of stage as i go)
if touching colour blue or touching colour green
repeat 10
change y by 9

and also

When uparrow pressed
forever
reapeat until colour grey is touching colour green or grey is touching colour blue
change y by -2


that is all my scripts. When I press right or left my scroll script doesnt do anything

What's not working? But I have something to mention:

Try changing your
     When uparrow pressed
     forever
     reapeat until colour grey is touching colour green or grey is touching colour blue
     change y by -2
                          script into this:

When Green Flag Clicked
forever
   repeat until color [feet color] is touching color [platform coating color]
   change y by -2

I'm not sure what part of it isn't working. Could you try explaining it a little more clearly?


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#29 2009-11-19 15:32:52

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Jumping works completely fine.
All that isn't working is making my scroll sprite move accross when I press right or left.

Offline

 

#30 2009-11-19 23:38:59

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

Jumping works completely fine.
All that isn't working is making my scroll sprite move accross when I press right or left.

Your sprite isn't supposed to move. It's the scrolling sprites that move. Check the link again to see it working.  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#31 2009-11-20 00:52:06

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

All that isn't working is making my scroll sprite move accross when I press right or left.

tongue  as I said... The main sprite works fine. it's the scroll sprite that isn't doing anything.

Last edited by JaredxD (2009-11-20 00:52:48)

Offline

 

#32 2009-11-20 00:54:37

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

If you want to really, fully, learn scrolling look at the scripts of a lot of archmage's projects  smile


Scratchin' since 2007

Offline

 

#33 2009-11-20 01:15:16

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Have done. But his stuff is just really pro and a little bit confusing for me  tongue

Offline

 

#34 2009-11-20 02:40:48

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

JaredxD wrote:

All that isn't working is making my scroll sprite move accross when I press right or left.

tongue  as I said... The main sprite works fine. it's the scroll sprite that isn't doing anything.

Oh! I'm sorry! You mean the scrolling sprites don't work?

Check that scrolling link again, it explains the scripting for it.

Here's the link: Learn Scrolling Now!

Check the bit about "set x to ........".


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#35 2009-11-20 03:59:16

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

YAY!! THANKS!
Dunno what I stuffed up, but the scroll sprite is now moving!  big_smile   big_smile   big_smile .

Thank you so much for your help man, sorry I wasted tons of you're time  tongue

One last question; when making other sprites in the project, how would I make it so they don't follow the scroll sprite like the character does? So they just stay in the one spot as the main character goes along.
If this sounds simpler to explain:
With the terrain(scroll sprite) I have, where it ends there is an orange line.
If the main character touches this line, I wanna be able to make him go to a sprite (the start sprite).
But I don't want this start sprite(that the character goes to if touching orange) to move along with the scroll script, I just want it to stay in one spot of the terrain. Sorta just like painting "start" in a different colour text, and making the sprite go to that colour if touching a different colour, but I'm not sure if that's possible.
Hope you can help =]


Cheers  smile

Last edited by JaredxD (2009-11-20 04:15:58)

Offline

 

#36 2009-11-21 01:47:11

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

One last question; when making other sprites in the project, how would I make it so they don't follow the scroll sprite like the character does? So they just stay in the one spot as the main character goes along.
If this sounds simpler to explain:
With the terrain(scroll sprite) I have, where it ends there is an orange line.
If the main character touches this line, I wanna be able to make him go to a sprite (the start sprite).
But I don't want this start sprite(that the character goes to if touching orange) to move along with the scroll script, I just want it to stay in one spot of the terrain. Sorta just like painting "start" in a different colour text, and making the sprite go to that colour if touching a different colour, but I'm not sure if that's possible.
Hope you can help =]

I'm confused... how many questions are there? Could you please state it differently?

Sorry if I'm silly.  tongue


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#37 2009-11-21 03:02:14

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

YAY!! THANKS!
Dunno what I stuffed up, but the scroll sprite is now moving!  big_smile   big_smile   big_smile .

Thank you so much for your help man, sorry I wasted tons of you're time  tongue

One last question; when making other sprites in the project, how would I make it so they don't follow the scroll sprite like the character does? So they just stay in the one spot as the main character goes along.
If this sounds simpler to explain:
With the terrain(scroll sprite) I have, where it ends there is an orange line.
If the main character touches this line, I wanna be able to make him go to a sprite (the start sprite).
But I don't want this start sprite(that the character goes to if touching orange) to move along with the scroll script, I just want it to stay in one spot of the terrain. Sorta just like painting "start" in a different colour text, and making the sprite go to that colour if touching a different colour, but I'm not sure if that's possible.
Hope you can help =]


Cheers  smile

I think you can just make the new sprite called sprite 4 for example, then:
[when green flag clicked]
[go to x(your x) y(your y)]

And that should make it stay at that x y. Then for the player:

in the forevers:

if touching color [color]
[][go to sprite 4]
[][][][][][][][][][][]

Do you mean that? Or do you want a sprite to appear at a specific scrolling time?

Last edited by fg123 (2009-11-21 03:03:01)


Hai.

Offline

 

#38 2009-11-21 16:06:21

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Yeh, at a specific point in the scrolling.

Hope this sounds less complicated:
There is a long track of road (scrolling sprites)
I want this "Start sprite" only to be seen at the first scrolling sprite. I want it to still be there, so if I touch red, I go back to it, but I don't want to be able to see it all the time in the scrolling.

So basically just at one certain point.

Offline

 

#39 2009-11-21 16:43:10

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

Just do on the 'start sprite'

When green flag
[if scroll x < 480 ]
[][show]
[][][][][][]
[else]
[][hide]
[][][][][][]

Then on the character:

Add:
When green flag
[forever]
[][if touching color [color]]
[][][set scroll x to (0)]
[][][go to [start sprite]]
[][][][][][][][][][]
[][][][][][][][]

Last edited by fg123 (2009-11-21 16:45:55)


Hai.

Offline

 

#40 2009-11-21 17:17:17

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Thank you soo much!!!
You two (Chrischb and fg123) are legends!
Dunno how to thank you enough, I will give you honourable mentions when I upload my project  smile

Offline

 

#41 2009-11-21 19:35:36

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

No, thank you for noticing my post. Usually people just ignore my post like it did not exists.  sad  But thanks for the honorable mention and I am looking forward to that project!!  smile


Hai.

Offline

 

#42 2009-11-21 21:06:28

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

One thing... I have a few terrain sprites, the things work really well (they are the same size) and all the scripts are the same for them (except the locations of them) and they are put on eachothers edge so it looks like one big long one, but when I move across, they separate? I have no idea why  sad

Offline

 

#43 2009-11-22 00:46:35

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

fg123 wrote:

No, thank you for noticing my post. Usually people just ignore my post like it did not exists.  sad  But thanks for the honorable mention and I am looking forward to that project!!  smile

I noticed it! Yay! I feel proud.  tongue

Anyway, now that we're legends, what shall we do next? My servants are building me a luxury boat to go sailing in... want to join?

JaredxD wrote:

One thing... I have a few terrain sprites, the things work really well (they are the same size) and all the scripts are the same for them (except the locations of them) and they are put on eachothers edge so it looks like one big long one, but when I move across, they separate? I have no idea why  sad

Now that's odd.  hmm

When they separate, is it that you can see a small line between them, or does the distance increase?

If it's a small line, do this:

When Green Flag Clicked
forever
   set x to blahblahbladyou_know_this_already
   if abs of x position > 460
      hide
   else
      show
   endif
endforever

It's not perfect, but Scratch doesn't have perfect edge sensing. But it's good enough for combatting the problem!  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#44 2009-11-22 03:25:57

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Distance increases.

Offline

 

#45 2009-11-22 05:28:40

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

Distance increases.

That's odd.  sad

I've never heard of a case of that, so maybe you should go over the scripts again? Try checking that scrolling formula again.  hmm


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#46 2009-11-23 02:15:28

JaredxD
Scratcher
Registered: 2009-09-10
Posts: 100+

Re: Need help with making a sprite jump and a few other things....

Nvm. Fixed it all up before, should've posted then and saved ya bit of time.
Game is now finished, am adding few more levels though, currently has two.
http://scratch.mit.edu/projects/JaredxD/771607

Offline

 

#47 2009-11-23 02:38:34

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

Nvm. Fixed it all up before, should've posted then and saved ya bit of time.
Game is now finished, am adding few more levels though, currently has two.
http://scratch.mit.edu/projects/JaredxD/771607

*click*


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#48 2009-11-26 11:50:49

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

Hi guys, I'm making an Adventure game for my friend who has returned to the internet.
He loves cows, so I decided to make him a CowAdventure game. The basic idea of it will be a cow escapes from a boring old farm, and gets trapped in adventure. The things I need helping with (by helping I mean recommending what scripts to use) these things:
- How to make a sprite Jump
- How to make it have health (i know this has something to do with variables) and lose it if it falls off the platforms
-How to make it land on platforms that are above the ground instead of going past them
-How to make backgrounds move along as the cow progresses, so it's more of a big background than the usual size (but you only see part of it until you get to the end of the bit you can see)

Please help, will be much appreciated =]

this should help:
when green flag clicked, forever, start if right arrow pressed, turn to 90, move 5 steps, end if, start if left key pressed, turn to -90, move 5 steps, end if, start if up arrow pressed, change y by 10, end if, start if not touching ground, change y by -10, forever end.

Offline

 

#49 2009-11-26 23:38:48

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need help with making a sprite jump and a few other things....

rdococ, please read previous replies. His problem is solved. His project is out, and you can see it at this link: http://scratch.mit.edu/projects/JaredxD/771607


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#50 2009-12-06 12:02:08

nerdz66
Scratcher
Registered: 2009-11-29
Posts: 1

Re: Need help with making a sprite jump and a few other things....

JaredxD wrote:

Oh and also, with the jump thingy, what I've got to jump is:
When Uparrow Pressed
if background of stage = 1
if touching colour white
repeat10
change y by 6

Thats for uparrow to jump, then for right arrow to go right i have
When rightarrow pressed
point in direction 90
if on edge bounce
change x by 10


Now when I press Up and Right, it only goes up but not across and up?

is back ground of stage a variable?and i ve done the right arrow thing but it doesn't work on jumping

Offline

 

Board footer