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

#1 2009-11-16 01:22:22

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

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

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 =]

Offline

 

#2 2009-11-16 01:32:52

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

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

That's a lot of things! Maybe you should search scroller or check out Archmage's projects for more help! I'm a bit lost...


Hai.

Offline

 

#3 2009-11-16 01:50:32

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

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

To make it scroll, try this: Learn Scrolling Now!.

To make it jump, download any platformer and search the scripts. Here's one: Cube Guy 2 - Wrong Dimension

To give it health, change the variable by -1 every time something bad happens, such as touching the color red or falling onto the bottom of the screen.

To work the platforms, click the second link; it'll tell you how as well.  smile

Hope that helped!


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

 

#4 2009-11-16 01:56:52

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

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

Thanks heaps  big_smile

Offline

 

#5 2009-11-16 02:01:33

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

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

So hows that second link tell me how to jump? I downloaded it and I couldn't even find out how to jump

Offline

 

#6 2009-11-16 02:07:45

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

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

maybe im just blind though

Offline

 

#7 2009-11-16 03:52:26

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

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

Hmm... try this link: SuperSprite CastleSiege!

Look at SuperSprite's scripts for the one that makes him jump.


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

 

#8 2009-11-16 04:10:51

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

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

It doesn't even show the script for it.

Offline

 

#9 2009-11-16 04:14:10

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

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

Look at scripts 12 and 13... they work together. Number 12 controls the falling, and number 13 controls the jumping. Try the project as well.


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

 

#10 2009-11-16 04:18:07

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

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

Ahh found it. Thanks alot mate! thats 2 things covered =]
Had a look at you're projects btw, they are awesome.
So do you know how the platforms work? Do I look at one of yours?

Offline

 

#11 2009-11-16 04:22:22

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

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

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?

Offline

 

#12 2009-11-16 18:57:32

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

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

Put them in separate scripts.


Hai.

Offline

 

#13 2009-11-16 23:59:33

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

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

JaredxD wrote:

So do you know how the platforms work? Do I look at one of yours?

No, because it's not the right style.  sad

Just download any classic platformer and examine the scripts! Here's a brief explanation:

Every platform has a specific color coating on the top.

The playing sprite has a color on their feet.

The player continuously falls if their feet are not on a platform.

The player will not fall if the feet color is touching the platform color.

..........................................
I'm not good at explaining this stuff, but hopefully it helps.  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

 

#14 2009-11-17 01:29:54

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

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

Thanks a mega-ton Chris!! That's helped alot and it is now working!
Lol I am in you're debt. =]

Offline

 

#15 2009-11-17 01:45:45

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

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

Hi last thing!, I have made a sprite to scroll, like it says (in ur scrolling project), the scripts the same as the one's you have there(for the scroll script), that all works n stuff, but how do I actually get the main sprite that moves around the scenes to move on from where you can see? it just runs into the wall and doesn't go further? do I need to do something to the sprite that's moving? Or do I need to do something with the background? Please help xD

Last edited by JaredxD (2009-11-17 01:46:23)

Offline

 

#16 2009-11-17 01:59:56

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

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

JaredxD wrote:

Thanks a mega-ton Chris!! That's helped alot and it is now working!
Lol I am in you're debt. =]

Forget the debt; I was glad to help.  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

 

#17 2009-11-17 02:02:34

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

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

JaredxD wrote:

Hi last thing!, I have made a sprite to scroll, like it says (in ur scrolling project), the scripts the same as the one's you have there(for the scroll script), that all works n stuff, but how do I actually get the main sprite that moves around the scenes to move on from where you can see? it just runs into the wall and doesn't go further? do I need to do something to the sprite that's moving? Or do I need to do something with the background? Please help xD

Hmm... I'm a bit confused. If the sprite changes its X Position, delete the script. Otherwise it'll smack into the wall, and it won't scroll properly.
A scroller works by having the sprite remain stationary, and the platforms move by as you push the left and right arrow keys. Change the ScrollX rather than its X.

Sorry if I didn't explain it well; I'm not so sure what happened. Maybe you could word it differently?


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

 

#18 2009-11-17 02:40:03

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

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

Ok, the scripts to move left and right for the sprite that moves along backgrounds is:
When Left Arrow Pressed
Point in Direction -90
Move 12 steps

When Right Arrow Pressed
Point in direction 90
move 12 steps.

The ones for the scroller are the same as you'rs, but Im not sure what I need for the sprite that jumps and all to move along from where you can see,

Offline

 

#19 2009-11-17 04:03:55

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

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

JaredxD wrote:

Ok, the scripts to move left and right for the sprite that moves along backgrounds is:
When Left Arrow Pressed
Point in Direction -90
Move 12 steps

When Right Arrow Pressed
Point in direction 90
move 12 steps.

The ones for the scroller are the same as you'rs, but Im not sure what I need for the sprite that jumps and all to move along from where you can see,

Delete the player's scripts. The only thing you need is the background to move; the player stays stationary except for jumping (and falling), which is along the Y axis.


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

 

#20 2009-11-17 04:28:50

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

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

So how do I make the background move?

Offline

 

#21 2009-11-17 04:31:01

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

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

And whenever I press green flag my stage moving script disappears?

Offline

 

#22 2009-11-18 01:49:25

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

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

please help xD

Offline

 

#23 2009-11-18 01:56:31

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

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

JaredxD wrote:

So how do I make the background move?

Extend the scrolling sprites so they look like full backgrounds.

JaredxD wrote:

And whenever I press green flag my stage moving script disappears?

You delete the scripts for the player. All it should be able to do is move up and down, while the sprites scroll around him; it gives the illusion of actual moving.


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

 

#24 2009-11-18 02:16:09

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

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

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?

Last edited by JaredxD (2009-11-18 02:19:34)

Offline

 

#25 2009-11-18 03:38:08

fullwall
Scratcher
Registered: 2009-10-29
Posts: 20

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

The background should be moving to always be moving to (variable name)x and y. (think this is how it works) This variable changes whenever you press left and right, giving the illusion of moving. Really all that is happening is the background is moving with you. Check out Archmage's projects for an example of this. Have you tried setting the variables to 0 first and moving the main sprite to that position?

Examples:

http://archblogger.wordpress.com/2008/11/06/make-a-game-like-super-mario-world-demo/
http://scratch.mit.edu/projects/archmage/635312 http://scratch.mit.edu/projects/archmage/145760

Last edited by fullwall (2009-11-18 03:47:25)

Offline

 

Board footer