Hi all scratchers!
To make a short introduction, this is my third account in Scratch's site (due to forgotten passwords) and I'm a maybe "big" or "complex" project of creating game which involves jumping and some things more.
OK, I'm not a native English-speaker. That means that if I explain t his stuff I need help with, you're very likely to get confused. I'll use a picture as an explanation:
http://imageshack.us/photo/my-images/84/daqapreg.png/
(Please note that I'm not allowed to place images yet since I'm a recent member. So take the annoying task of pasting the link on a tab of your browser. Sorry )
Offline
I don't exactly understand the diagram, but this may help... again, this is just to my understanding of the diagram...
<when[space v] key pressed> Change y by (10) set [place v] to (pick random(1) to(3))this will only get you past the first little part, though...
Last edited by wasabi56 (2012-06-02 00:50:16)
Offline
Yeah, sounds interesting and gave me an idea.
Thx.
However, I'll try to explain in words:
You have 2 types of side-scrolling games. #1 Purely 2D (like Mario games) when you move forward or backwards and you can jump; and some other games (#2) allow you to move forward, backwards, up and down AND jump (that looks "like" 3D). In this second type, the game levels something like lanes or similar and you move through them by moving up or down. If you are in a lower lane and jump, while you're in the air, it could look like you're in a higher on but then you land the jump, back to lane you jumped from.
If you're in a high lane and jump, could look like you are in the scenario background, but you soon return to the high lane you were.
Tryin to make it simpler:
NOTE: since Scratch limits me to 480x360 res, I won't make more than 3 lanes in my game. Something like this:
NORMAL (#1)
1 <You're here> Jump A <land here> [1 ------> A]
WITH "LANES" OR LAYERS (#2)
1 <U may be here> A <U may land here>
2 <U may be here> B <U may land here>
3 <U may be here> C <U may land here>
Possibilities: 1 ----JUMP-----> A (same lane) or B or C
2 ----JUMP-----> B (same lane) or A or C
3 ----JUMP-----> C (same lane) or A or C.
Anyone got it?
Offline
Well as far as I can tell, all you really need is to have 3 variables involved: your x, your y, and your z.
X is your moving back and fourth.
Y is your jumping.
Z is your movement through the layers.
You want to make jumping completely independent of your lane movement it sounds like, so you could make controls like this:
Left arrow = x moves negative
Right arrow = x moves positive
Up arrow = z moves negative
Down arrow = z moves positive
space bar = jump
I don't know if this is what you want, but it sounds like it.
Offline
Daqa wrote:
That's simply a GR8 idea, but if I'm not wrong it's not possible coz Scratch only manages x and y axis, and z axis should be something like y but with another name.... I don't know.
You can determine a sprite's projected position on a 2D plane very simply by dividing by the z. In your case, the closest lane to the bottom of the screen is z=1, then as you go up the screen, z=2, z=3
your x, y, and z are completely independent. Your sprite's x position and y position are determined by x/z and y/z respectively. If you want more help, I can point you to few projects that show this or simply make an example.
Offline
Daqa wrote:
Yeah, sounds interesting and gave me an idea.
Thx.
However, I'll try to explain in words:
You have 2 types of side-scrolling games. #1 Purely 2D (like Mario games) when you move forward or backwards and you can jump; and some other games (#2) allow you to move forward, backwards, up and down AND jump (that looks "like" 3D). In this second type, the game levels something like lanes or similar and you move through them by moving up or down. If you are in a lower lane and jump, while you're in the air, it could look like you're in a higher on but then you land the jump, back to lane you jumped from.
If you're in a high lane and jump, could look like you are in the scenario background, but you soon return to the high lane you were.
Tryin to make it simpler:
NOTE: since Scratch limits me to 480x360 res, I won't make more than 3 lanes in my game. Something like this:
NORMAL (#1)
1 <You're here> Jump A <land here> [1 ------> A]
WITH "LANES" OR LAYERS (#2)
1 <U may be here> A <U may land here>
2 <U may be here> B <U may land here>
3 <U may be here> C <U may land here>
Possibilities: 1 ----JUMP-----> A (same lane) or B or C
2 ----JUMP-----> B (same lane) or A or C
3 ----JUMP-----> C (same lane) or A or C.
Anyone got it?
Okay, I get it now, you could have the 3 lanes be sprites and have:
<when [space v] key pressed> perform jump you want when gf clicked forever if <touching [sprite 2 v]?>// lane #1 set [lane v] to(1) end if <touching [sprite 3 v]?>// lane #2 set [lane v] to(2) end if <touching [sprite 4 v]?>// lane #3 set [lane v] to(3) endIf you need help with the actual gravity after this, just ask
Last edited by wasabi56 (2012-06-03 01:07:37)
Offline
wasabi56 wrote:
Okay, I get it now, you could have the 3 lanes be sprites and have:
<when [space v] key pressed> perform jump you want when gf clicked forever if <touching [sprite 2 v]?>// lane #1 set [lane v] to(1) end if <touching [sprite 3 v]?>// lane #2 set [lane v] to(2) end if <touching [sprite 4 v]?>// lane #3 set [lane v] to(3) endIf you need help with the actual gravity after this, just ask
Alright, thank you. But how will Scratch understand "lane=1" means "jump from lane 1 and come back there"?
Offline
AtomicBawm3 wrote:
You can determine a sprite's projected position on a 2D plane very simply by dividing by the z. In your case, the closest lane to the bottom of the screen is z=1, then as you go up the screen, z=2, z=3
your x, y, and z are completely independent. Your sprite's x position and y position are determined by x/z and y/z respectively. If you want more help, I can point you to few projects that show this or simply make an example.
Please point them. (I love reverse engineering)
Offline
Daqa wrote:
wasabi56 wrote:
Okay, I get it now, you could have the 3 lanes be sprites and have:
<when [space v] key pressed> perform jump you want when gf clicked forever if <touching [sprite 2 v]?>// lane #1 set [lane v] to(1) end if <touching [sprite 3 v]?>// lane #2 set [lane v] to(2) end if <touching [sprite 4 v]?>// lane #3 set [lane v] to(3) endIf you need help with the actual gravity after this, just askAlright, thank you. But how will Scratch understand "lane=1" means "jump from lane 1 and come back there"?
Would the different lanes be different colors?
Offline
wasabi56 wrote:
Daqa wrote:
wasabi56 wrote:
Okay, I get it now, you could have the 3 lanes be sprites and have:
<when [space v] key pressed> perform jump you want when gf clicked forever if <touching [sprite 2 v]?>// lane #1 set [lane v] to(1) end if <touching [sprite 3 v]?>// lane #2 set [lane v] to(2) end if <touching [sprite 4 v]?>// lane #3 set [lane v] to(3) endIf you need help with the actual gravity after this, just askAlright, thank you. But how will Scratch understand "lane=1" means "jump from lane 1 and come back there"?
Would the different lanes be different colors?
I'm thinking in different colors, and then hiding the sprites behind a scenario.
Offline
Daqa wrote:
wasabi56 wrote:
Daqa wrote:
Alright, thank you. But how will Scratch understand "lane=1" means "jump from lane 1 and come back there"?
Would the different lanes be different colors?
I'm thinking in different colors, and then hiding the sprites behind a scenario.
Okay, then this might just work:
when gf clicked forever if <<lane>=(1)> if <touching color [color of lane #1]?> change y by(5) end if <not<touching color[color of lane #1]?>> change y by(-5) end end if <<lane>=(2)> if <touching color [color of lane #2]?> change y by(5) end if <not<touching color[color of lane #2]?>> change y by(-5) end end if <<lane>=(3)> if <touching color [color of lane #3]?> change y by(5) end if <not <touching color [color of lane #3]?>> change y by (-5) end endSorry I couldn't get the variables to work
Offline
wasabi56 wrote:
Daqa wrote:
wasabi56 wrote:
Would the different lanes be different colors?I'm thinking in different colors, and then hiding the sprites behind a scenario.
Okay, then this might just work:
when gf clicked forever if <<lane>=(1)> if <touching color [color of lane #1]?> change y by(5) end if <not<touching color[color of lane #1]?>> change y by(-5) end end if <<lane>=(2)> if <touching color [color of lane #2]?> change y by(5) end if <not<touching color[color of lane #2]?>> change y by(-5) end end if <<lane>=(3)> if <touching color [color of lane #3]?> change y by(5) end if <not <touching color [color of lane #3]?>> change y by (-5) end endSorry I couldn't get the variables to work
Tell me if this works or not
Thanks a lot, but I'm not sure if this will work WITH jumping. I mean, you didn't include jumps in your script.
But anyway it's givin a hint in this hard work.
Offline
Daqa wrote:
wasabi56 wrote:
Daqa wrote:
I'm thinking in different colors, and then hiding the sprites behind a scenario.Okay, then this might just work:
when gf clicked forever if <<lane>=(1)> if <touching color [color of lane #1]?> change y by(5) end if <not<touching color[color of lane #1]?>> change y by(-5) end end if <<lane>=(2)> if <touching color [color of lane #2]?> change y by(5) end if <not<touching color[color of lane #2]?>> change y by(-5) end end if <<lane>=(3)> if <touching color [color of lane #3]?> change y by(5) end if <not <touching color [color of lane #3]?>> change y by (-5) end endSorry I couldn't get the variables to work
Tell me if this works or notThanks a lot, but I'm not sure if this will work WITH jumping. I mean, you didn't include jumps in your script.
But anyway it's givin a hint in this hard work.
Well, jumping should work with it, because it's one of my platformer gravity (with jumping) scripts... sorry if it doesn't
Offline
wasabi56 wrote:
Daqa wrote:
wasabi56 wrote:
Okay, then this might just work:when gf clicked forever if <<lane>=(1)> if <touching color [color of lane #1]?> change y by(5) end if <not<touching color[color of lane #1]?>> change y by(-5) end end if <<lane>=(2)> if <touching color [color of lane #2]?> change y by(5) end if <not<touching color[color of lane #2]?>> change y by(-5) end end if <<lane>=(3)> if <touching color [color of lane #3]?> change y by(5) end if <not <touching color [color of lane #3]?>> change y by (-5) end endSorry I couldn't get the variables to work
Tell me if this works or notThanks a lot, but I'm not sure if this will work WITH jumping. I mean, you didn't include jumps in your script.
But anyway it's givin a hint in this hard work.Well, jumping should work with it, because it's one of my platformer gravity (with jumping) scripts... sorry if it doesn't
OK, I jump by pressin X. The problem with this script is that I got stuck in one lane, happens the same moving on y axis by jumping or by presing up arrow.
BTW, what do u mean by "one of my platformer gravity (with jumping) scripts"?
Offline
See if this helps:
http://scratch.mit.edu/projects/amcerbu/1006552.
Use the arrow keys to move the ball left/right/up/down, and use the "w" and "s" keys to move it forward and backward.
If you need me to explain the scripts, I can do that, but I want to make sure this what you're looking for first.
Offline
amcerbu wrote:
See if this helps:
http://scratch.mit.edu/projects/amcerbu/1006552.
Use the arrow keys to move the ball left/right/up/down, and use the "w" and "s" keys to move it forward and backward.
If you need me to explain the scripts, I can do that, but I want to make sure this what you're looking for first.
This was one of the projects I was going to point you towards . I can't seem to find the others...but I can make an example for you since I'm pretty confident I understand what you want.
Offline
Daqa wrote:
wasabi56 wrote:
Daqa wrote:
Thanks a lot, but I'm not sure if this will work WITH jumping. I mean, you didn't include jumps in your script.
But anyway it's givin a hint in this hard work.Well, jumping should work with it, because it's one of my platformer gravity (with jumping) scripts... sorry if it doesn't
OK, I jump by pressin X. The problem with this script is that I got stuck in one lane, happens the same moving on y axis by jumping or by presing up arrow.
BTW, what do u mean by "one of my platformer gravity (with jumping) scripts"?
Oh yeah, it occurs to me that the two scripts counteract each other...ummm maybe you could make the center of each lane a darker shade and have that be the landing place rather than the top of each lane...and not have the jump be high enough to touch the center of the next lane, and change the "touching sprite [ v]?" To "touching color [color of center of lane]"
P.S. I mean that it is my preferred gravity script for platformer games where you can jump.
Offline
Oh wait, found one: http://scratch.mit.edu/projects/Kileymeister/1413602
EDIT: and here's mine: http://scratch.mit.edu/projects/A__B__3 … _T/2587189
Last edited by AtomicBawm3 (2012-06-04 11:23:40)
Offline
Checkin' "Help for Daqa".
First, I think it can help A LOT of people, not just me. Second, I'll have to open and view the project many and many times (in order to adapt it to my game) coz involves a lot of deep thinking to understand, ha-ha-ha!
Offline