Discuss Scratch

FallenOak
Scratcher
27 posts

Make Solid River With Bridge

Ok, first I have looked to find help but I cant find any…Its probably there somewhere, but I havent found one so Im just posting for help.

In my game, one area has a river. Also it has a tree that falls down to make a bridge. What I want is to make the river solid with the bridge that will let you get across.
I have tried to do this but it never seems to work.. I imagine I'm just missing one simple script…


I have to go now, please answer my question though!
Psiborg
Scratcher
500+ posts

Make Solid River With Bridge

How you solve this will depend on how you have coded the river and tree and also your movement. It will be a lot easier to help you if you can share your project.

Save the world from giant ants in a classic tower defense: Antfestation
Protect the Minions from the Purples in Minion Push
Collect treasure across the beautiful islands of Mylands
Guard your gold in The Hoard++
Remake of a classic arcade game: Descentipede

ErnieParke
Scratcher
1000+ posts

Make Solid River With Bridge

This is actually a simple solution. I'm working on the same issue, though I'm facing a bit of a different problem.

Anyway, do you have walls in your game yet? Also, does the water have some color which it uses a lot? Right now, I'm thinking about making your game think the river is a wall, but I'd like to know the above two things first.

By the way, hello FallenOak and welcome to Scratch! I wish you a smooth road to learning how to make a good game. :)

With regards,

ErnieParke

FallenOak
Scratcher
27 posts

Make Solid River With Bridge

Ok, I don't have any walls yet and also the river is the only thing that colour and it is all the same colour (apart from a few paler lines in it).
mitchboy
Scratcher
1000+ posts

Make Solid River With Bridge

Ha- “tree falls down”- FallenOak

I see what you did there…

Well, anyway, this can be done pretty simply. Just have an <if <not touching [colorofriver]>> then move. I would explain more, but I'm on a tablet.

Capsicum annuum.
FallenOak
Scratcher
27 posts

Make Solid River With Bridge

Thanks, I just tried that and it works, the character stops, but then it doesn't move anymore at all.. Thank you for helping me with that though, this will be easier to solve (probably!)
ErnieParke
Scratcher
1000+ posts

Make Solid River With Bridge

FallenOak wrote:

Thanks, I just tried that and it works, the character stops, but then it doesn't move anymore at all.. Thank you for helping me with that though, this will be easier to solve (probably!)
The reason his method doesn't work is because once your character moves into a river, you'll be touching it. Since you check for the river's color to see if you can move, you'll be stuck there forever because you can't move out.

Instead, I'd recommend a slight twist:

move
if (touching color [river]?) then
move backwards
end

Do you see how that works?

With regards

ErnieParke

Last edited by ErnieParke (Aug. 16, 2013 21:36:53)


FallenOak
Scratcher
27 posts

Make Solid River With Bridge

Thank you everyone. I'm not entirely sure how, but I've made it so you slow down when you are touching the river, which works better than making a wall.



Fa//enOak

Powered by DjangoBB