I am working on a one sprite, one script two player game. There is one player, a black stickman, and another, a white stickman. I can't really describe things, so here is a picture of the stage:
It's said that one picture is worth a thousand words, so I hope that puts a good image of the game play in your head. When the white player jumps, it goes down.
Now for the real part that this thread was made for: the problem, the (personificationally speaking:) antagonist, the issue:
When ever the black stickman jumps, he doesn't come down. He just stays in the air. But I just copied the black stickman's part of the script an put them in for the white stickman parts of the script and changed the variables to match. I can't figure out what I'm doing wrong.
Here is the script:
(remember, this is a 1s1s)
THE VARIABLE KEY:
B=Black Stickman
W=White Stickman
X=X Position
Y=Y Position
V=Velocity.
Why doesn't he go down? I feel like this will be one of those dumb questions with a simple answer that I can't seem to figure out.
EDIT: Here is a link to my test account's project: pu ssem reyalp owt. (two player mess up backwards)
HENLEYTEST'S PROJECT
Last edited by henley (2010-07-14 09:05:15)
Offline
henley wrote:
I am working on a one sprite, one script two player game. There is one player, a black stickman, and another, a white stickman. I can't really describe things, so here is a picture of the stage:
http://i27.tinypic.com/70cbqc.png
It's said that one picture is worth a thousand words, so I hope that puts a good image of the game play in your head. When the white player jumps, it goes down.
Now for the real part that this thread was made for: the problem, the (personificationally speaking:) antagonist, the issue:
When ever the black stickman jumps, he doesn't come down. He just stays in the air. But I just copied the black stickman's part of the script an put them in for the white stickman parts of the script and changed the variables to match. I can't figure out what I'm doing wrong.
Here is the script:
(remember, this is a 1s1s)
THE VARIABLE KEY:
B=Black Stickman
W=White Stickman
X=X Position
Y=Y Position
V=Velocity.
http://i30.tinypic.com/10x63bk.gif
Why doesn't he go down? I feel like this will be one of those dumb questions with a simple answer that I can't seem to figure out.
I seriously can't work this one out, it looks right, im not very good at this kind of thing, Im thinking has something to do with the *0.9 but I don't see why that wouldn't work, I'vejust checked it on my calculator but it works both ways, so sorry but I'm no help.
Offline
markyparky56 wrote:
I seriously can't work this one out, it looks right, im not very good at this kind of thing, Im thinking has something to do with the *0.9 but I don't see why that wouldn't work, I've just checked it on my calculator but it works both ways, so sorry but I'm no help.
The 0.9 is on both the black and white, and it's for movement, not jumping.
Offline
Oh, I think i've spotted it!
Black doesn't have the
[blocks]<if> <not> <touching color[ ◘ ] >>
<change{ BYV }by( 1/-1 )
<end>
[/blocks]
script!
Last edited by markyparky56 (2010-07-14 09:47:10)
Offline
markyparky56 wrote:
Oh, I think i've spotted it!
Black doesn't have the
[blocks]<if> <not> <touching color[ ◘ ] >>
<change{ BYV }by( 1/-1 )
<end>
[/blocks]
script!
Good observation! But, if I do that, instead of just not coming down, it keeps on going upward.
Offline
henley wrote:
markyparky56 wrote:
Oh, I think i've spotted it!
Black doesn't have the
[blocks]<if> <not> <touching color[ ◘ ] >>
<change{ BYV }by( 1/-1 )
<end>
[/blocks]
script!Good observation! But, if I do that, instead of just not coming down, it keeps on going upward.
Even if its -1?
Offline
markyparky56 wrote:
henley wrote:
markyparky56 wrote:
Oh, I think i've spotted it!
Black doesn't have the
[blocks]<if> <not> <touching color[ ◘ ] >>
<change{ BYV }by( 1/-1 )
<end>
[/blocks]
script!Good observation! But, if I do that, instead of just not coming down, it keeps on going upward.
Even if its -1?
Yes. I tried both.
Offline
You need to go to the BLACK's position when testing for colors, right now (because the white is drawn last) it's at the WHITE's position. I just put this:
[clear]
[switch to costume black]
[go to bx by]
... (detection
[stamp]
[switch to costume white]
[go to wx wy]
... (detection
[stamp]
Last edited by nXIII (2010-07-14 12:12:59)
Offline
I fixed it! (sorry nXIII I tried that and I'm pretty sure it doesn't work) it turns out that color sensing doesn't work, so you have to do it with the variables.
here it is
Offline
ScratchReallyROCKS wrote:
I fixed it! (sorry nXIII I tried that and I'm pretty sure it doesn't work) it turns out that color sensing doesn't work, so you have to do it with the variables.
here it is
You are wrong.
http://scratch.mit.edu/projects/nXIII/1191200
Last edited by nXIII (2010-07-14 13:06:15)
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
I fixed it! (sorry nXIII I tried that and I'm pretty sure it doesn't work) it turns out that color sensing doesn't work, so you have to do it with the variables.
here it isYou are wrong.
http://scratch.mit.edu/projects/nXIII/1191200
Oh, I see, you put the stamp blocks in a different place than I did when I tried it. Well, your way doesn't work any better than mine and my way doesn't work any better than yours, so I guess he could use either.
Offline
ScratchReallyROCKS wrote:
nXIII wrote:
ScratchReallyROCKS wrote:
I fixed it! (sorry nXIII I tried that and I'm pretty sure it doesn't work) it turns out that color sensing doesn't work, so you have to do it with the variables.
here it isYou are wrong.
http://scratch.mit.edu/projects/nXIII/1191200Oh, I see, you put the stamp blocks in a different place than I did when I tried it. Well, your way doesn't work any better than mine and my way doesn't work any better than yours, so I guess he could use either.
My way works better because the stage isn't always flat, it can have objects in it. your way doesn't work with color sensing.
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
nXIII wrote:
You are wrong.
http://scratch.mit.edu/projects/nXIII/1191200Oh, I see, you put the stamp blocks in a different place than I did when I tried it. Well, your way doesn't work any better than mine and my way doesn't work any better than yours, so I guess he could use either.
My way works better because the stage isn't always flat, it can have objects in it. your way doesn't work with color sensing.
Yeah, that's true.
So, henley, are you going to make a game out of this?
Offline
Yay! It's fixed! And yes ScratchReallyROCKS, I am making a game out of it. I am using nXIII's way because it works faster, and the variables are confusing me.
Well, I guess there is no need for this topic anymore.
Offline
henley wrote:
Well, I guess there is no need for this topic anymore.
Closing
Offline