Pages: 1 2
Topic closed
JaredxD wrote:
I don't understand... I deleted the scripts for the player, but the scroll sprite still disappears when I press green flag
![]()
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?
Offline
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
JaredxD wrote:
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?
Offline
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.
Offline
JaredxD wrote:
All that isn't working is making my scroll sprite move accross when I press right or left.
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
JaredxD wrote:
JaredxD wrote:
All that isn't working is making my scroll sprite move accross when I press right or left.
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 ........".
Offline
YAY!! THANKS!
Dunno what I stuffed up, but the scroll sprite is now moving!
.
Thank you so much for your help man, sorry I wasted tons of you're time
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
Last edited by JaredxD (2009-11-20 04:15:58)
Offline
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.
Offline
JaredxD wrote:
YAY!! THANKS!
Dunno what I stuffed up, but the scroll sprite is now moving!![]()
![]()
.
Thank you so much for your help man, sorry I wasted tons of you're time![]()
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![]()
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)
Offline
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
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)
Offline
No, thank you for noticing my post. Usually people just ignore my post like it did not exists. But thanks for the honorable mention and I am looking forward to that project!!
Offline
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
Offline
fg123 wrote:
No, thank you for noticing my post. Usually people just ignore my post like it did not exists.
But thanks for the honorable mention and I am looking forward to that project!!
![]()
I noticed it! Yay! I feel proud.
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
![]()
Now that's odd.
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!
Offline
JaredxD wrote:
Distance increases.
That's odd.
I've never heard of a case of that, so maybe you should go over the scripts again? Try checking that scrolling formula again.
Offline
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
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*
Offline
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
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
Offline
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
Topic closed
Pages: 1 2