I want to talk about how to make stuff move. I know that that sounds silly, but it is difficult to make moving backgrounds and such. It can also be difficult to have a sprite rebound off of a certain color. If you have any suggestions, you can post them here.
Offline
legomany3448 wrote:
I want to talk about how to make stuff move. I know that that sounds silly, but it is difficult to make moving backgrounds and such. It can also be difficult to have a sprite rebound off of a certain color. If you have any suggestions, you can post them here.
Hello legomany3448!
If you want to make a scrolling platformer game, if I correctly understood what you are trying to say, I suggest you check out this project by archmage that will teach you everything you need.
Link: http://scratch.mit.edu/projects/archmage/76150
It's not silly to ask questions when you are new too Scratch, so feel free to ask any questions when you need help.
Welcome to Scratch, and Scratch on!
Offline
That's realy cool, but it's not what I meant. I'm trying to make a maze game where I have a little black dot that travels through a maze. I'm using a dark gray as the walls. I'm trying to figure out how not to let the black dot go through the walls. But yes, other people may apreciate that post seeing as this is a fourm about sprites moving in general.
[blocks]<when green flag clicked><say[Thanks though!]>[/blocks]
Offline
try this:
<when[ right arrow ]key pressed>
<point in direction( 90
<repeat until><< <not> >><key[ right arrow ]pressed?> <move( 3 )steps>
then duplicate this script, and change the direction and arrow key blocks to left arrow, up arrow, and down arrow. Get it? Hope I helped!
Last edited by militarydudes (2010-09-03 13:06:29)
Offline
legomany3448 wrote:
That's realy cool, but it's not what I meant. I'm trying to make a maze game where I have a little black dot that travels through a maze. I'm using a dark gray as the walls. I'm trying to figure out how not to let the black dot go through the walls. But yes, other people may apreciate that post seeing as this is a fourm about sprites moving in general.
[blocks]<when green flag clicked><say[Thanks though!]>[/blocks]
I knew I would misunderstand what you were saying so I warned you on my original post. I'll give you the scripts now that I know what you mean.
Black dot (Your Player):
[blocks]
<when green flag clicked>
<if<key[ Down Arrow ]pressed?>>
<change y by(-10
[/blocks]
This is the script to help your black dot move. You would have to repeat this same script four times in order to make it move up, down, left, and right and also change the y position to correspond with the direction you are moving into.
Black dot (Your Player):
[blocks]
<when green flag clicked>
<forever if <touching color[(Color of walls) >
<broadcast[ You lose!
[/blocks]
This is the script that would be used to prevent the player from touching the walls and being able to get away with it.
Here's a good example of a maze that you can use too:
http://scratch.mit.edu/projects/Alex13/507
Have fun with your project and Scratch on!
Offline
DistantVisit wrote:
legomany3448 wrote:
That's realy cool, but it's not what I meant. I'm trying to make a maze game where I have a little black dot that travels through a maze. I'm using a dark gray as the walls. I'm trying to figure out how not to let the black dot go through the walls. But yes, other people may apreciate that post seeing as this is a fourm about sprites moving in general.
[blocks]<when green flag clicked><say[Thanks though!]>[/blocks]Black dot (Your Player):
[blocks]
<when green flag clicked>
<forever if <touching color[(Color of walls) >
<broadcast[ You lose!
[/blocks]
Let me add on to that. when you brodcast you lose, put this on a sprite that says "You Lose!":
<when green flag clicked>
<hide>
<when I receive[ you lose! ]
<show>
<stop all>
Offline
Good. I like your idea distantvisit, but I think we should modify it to:
[blocks]<when[rightarrow]key pressed>
<point in direction(90)
<repeat until><<<< <not><key[right arrow]pressed?>>><or><touching color[ >>
<move(3)steps>
<end>[/blocks]
Offline
I just tried. It didn't work. Luckily, I have other resourses...
[blocks]
<when green flag clicked>
<say[ ]>
[/blocks]
Offline
legomany3448 wrote:
Good. I like your idea distantvisit, but I think we should modify it to:
[blocks]<when[rightarrow]key pressed>
<point in direction(90)
<repeat until><<<< <not><key[right arrow]pressed?>>><or><touching color[ >>
<move(3)steps>
<end>[/blocks]
why didn't I think of that!? It seems you figured it out for yourself
Offline
It seems everything about your question has been answered here
Never be afraid to ask questions that may sound 'silly'.
Just remember, we are all still learning and asking the more expirenced users is a top tip!
Offline
I realy didn't post this fourm for me. It was just that I was having a problem so I figured that other people would also apreciate it. I probably won't be checking this any more so that other people could post their problems with moving on here. I did this more for the help of other people not me. But if I do have another question about moving then i probably will come back here. Hope you have fun!
[blocks]
<when green flag clicked>
<say[ Have fun!
<forever>
<say[ Have fun!
<end>
Offline
how do you make stuff go left? i did the right thing accept left but i went upside down
Offline
soraroxas11 wrote:
how do you make stuff go left? i did the right thing accept left but i went upside down
Ok, click on your sprite.
Now on the stage, at the top next to the mini pic of the sprite, you'll see 3 boxes: 2 have arrows in them, one has a square.
Click on the one which says 'don't rotate' when you hover over it with your mouse.
Now try again...
Hope I helped
Offline
soraroxas11 wrote:
how do you make stuff go left? i did the right thing accept left but i went upside down
Good question...Right above the area in the left of the screen where the little tabs that say scripts, costumes, and sounds, there are three icons: one of them shows a full arrow sort of circle, another one shows a line that goes from left to right, an another one just shows a sprite sitting there doing nothing. Click on the circle to make your sprite be able to turn upsidedown. Click the line to make your sprite only face left and right. Click the still dot to make a sprite not rotate at all. Unfortunately, you cannot tell a sprite to change this durring programming. (Note: When telling your sprite to not rotate or to only face left and right, it will still go up if you tell it to go up, it just won't show that it is pointing upwards unless you tell Scratch to show that sprite's direction.
[blocks]
(If you DO wish to show a sprite's direction on the screen on the website, in
presentation mode, and in programming mode, then click on the little box next to <direction> where you drag blocks from to show that sprite's direction. It will show up as a variable on the screen, only it will be blue because that is the color for motion. You can use this trick with other values too, like the <volume> in sound or even a predicate like <mouse down?> from sensing.)
[blocks]
Good luck! <-- this is you (hopefully)
Offline
I'm new to scratch to but I may know what you meant but you can use<repeat until> then use <forever>if touching color dark gray move o step and point in direction of mouse to get the dot to continue moving. Or you could make the walls a sprite themselves and make them react using sensing. I hope your game turns out good.
Offline