This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-12-19 11:12:19

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

How to make a 3d ssb game for zawicki1fromyoutube

Now lots have people have seen others make lots of SSB games. Though most had 1 thing in common. THEY WEREN'T 3D LIKE THE ACTUAL GAMES AND THEY DIDN'T ZOOM IN AND OUT! But now I can change all of that. Now I will teach all you scratchers worldwide including zawicki1fromyoutube, how to make a ssb game, thats 3d.

Part 1: Variables and Sprites
First we need to quickly create all the variables. Note that there are more in my actual version, thats because in the actual one I can choose the stage, have sensors, use shield, show a replay, and more which is not what I'm doing here. Heres all of what were using today and what they do:

-Battle Done?-When the game starts its set to 0(false), and the main movement scripts keep on working until its 1(true)
-P1 Damage-This keeps track of how much damage P1 has taken.
-P1 Jump Limit-This keeps track of how many jumps the player has done makes sure P1 doesn't make more than 2 jumps without touching the ground.
-P1 X Place-This isn't where P1 is on the screen (x position), this is where the player is in the entire "world"
-P1 Y Place-This isn't where P1 is on the screen (y position), this is where the player is in the entire "world"
-P1 X Velocity-This keeps track of how fast P1 is moving left and right.
-P1 Y Velocity-This keeps track of how fast P1 is moving up and down.
-P2 Damage-This keeps track of how much damage P2 (or CPU) has taken.
-P2 Jump Limit-This keeps track of how many jumps the player has done makes sure P1 doesn't make more than 2 jumps without touching the ground.
-P2 X Place-This isn't where P2 is on the screen (x position), this is where the player is in the entire "world"
-P2 Y Place-This isn't where P2 is on the screen (y position), this is where the player is in the entire "world"
-P2 X Velocity-This keeps track of how fast P2 is moving left and right.
-P2 Y Velocity-This keeps track of how fast P2 is moving up and down.
-Stage X Place-Even though the Stage doesn't "actually" move, it is required to make the 3d effect
-Stage Y Place-Even though the Stage doesn't "actually" move, it is required to make the 3d effect

And specifically for the Stage sprite we have these variables:

-Stage Size-The current variable that is used in the formula.

Also on the screen, the only variables that you want to show are P1 Damage and P2 Damage. And for the Sprites. You need P1 and P2, and the Stage (as a sprite because it will be changing size) and then you can start scripting!

Part 2: P1 and P2 (not CPU) Movement
Next we need to use the variables and create the actual movement and good jumping and more. So now we'll start off with this:

When Green Flag Clicked
Set [Battle done?] to (0)
Set [P1 X Velocity] to (0)
Set [P1 Y Velocity] to (0)
Set [P1 X Place] to (-180)        <---All of this resets everything for a new equal and fair game
Set [P1 Y Place] to (100)
Set [P1 Jump Limit] to (0)
Set [P1 Damage] to (0)

So now we can make the actual movement such.

Repeat until <(Battle Done)=1>
-If <key [right arrow] pressed> and <[Abs] of (P1 X Velocity) < 13>   <---If your pressing right and your not going to fast...
--change [P1 X Velocity] by 2    <---Go faster
--point direction (90)                 <---Turn right
-If <key [left arrow] pressed> and <[Abs] of (P1 X Velocity) < 13>   <---If your pressing left and your not going to fast
--change [P1 X Velocity] by -2    <---Go faster
--point direction (-90)                 <---Turn left
-If <touching [stage (the sprite)]> and < P1 Y Velocity < (0.1) >   <---If your on the ground your still or falling
--Set [P1 Jump Limit] to (0)      <---Give the ability to jump
--Set [P1 Y Velocity] to (1)     <---Stop Falling
--If <key [up arrow] pressed>      <---If you press up
---change [P1 Y velocity] by (18)       <---Quickly start to go up
---change [P1 Jump Limit] to           <---Make it so you can only jump one more time unless you touch the ground

So with this, you will soon be able to move, but not yet, because you need to add a little bit more scripts:

-If < [abs] of [P1 X Position] > (700) or [abs] of [P1 Y Position] > (600) >    <---If your out of bounds (about to die)
--Set [Battle done?] to 1    <---If you die you will end the battle.
-Change [P1 Y Velocity] by (-1)   <---Gravity
Set [P1 X Velocity] to (P1 X Velocity]) X 0.85   <---This makes P1 slow down
Change [P1 X Place] by (P1 X Velocity)  <---This makes P1 actually change its place
Change [P1 Y Place] by (P1 Y Velocity)  <---This makes P1 actually change its place
Set X to ((P1 X Place) X ([size] of [Stage (sprite) / 100 ) + (Stage X Place) X ([size] of [Stage (sprite) / 100 )
Set Y to ((P1 Y Place) X ([size] of [Stage (sprite) / 100 ) + (Stage Y Place) X ([size] of [Stage (sprite) / 100 )
Set Size to ([size] of [Stage (Sprite)]

Now this, has completed the movement section. Also for P2 just copy this and just change the controls and variables a bit.

Part 3: Stage Movement and Effect

Finally we go to the stage sprite and enter this large script:

When Green Flag Clicked
Set [Size] to (80)
Set [Stage X] to (0)
Set [Stage Y] to (0)
Set [Battle done?] to (0)
Repeat until < (Battle done?) = 1 >
-Set Size to (Stage Size)
-Set X to (Stage X) X (Size / 100)
-Set Y to (Stage Y) X (Size / 100)
-Set Stage Size to 120 + -1 X [abs] of sqrt of P1 X Place - P2 X Place * P1 X Place - P2 X Place + P1 Y Place - P2 Y Place + Y Place - P2 Y Place X 0.2 + Distance to P1 + Distance to P2 / 20

Though I'm kinda tired, so um thats all I'm doing for now. (Boy this took like and hour to type...)

Last edited by Lucario621 (2008-12-19 12:20:50)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#2 2008-12-19 11:33:43

zawicki1fromyoutube
Scratcher
Registered: 2008-07-31
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

Thanks man!


|Call Of Duty: Black Ops Wii Friend Code: 3519-4456-0013|
|Follow me on Twitter|Subscribe To My Youtube Channel

Offline

 

#3 2008-12-19 12:01:55

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

zawicki1fromyoutube wrote:

Thanks man!

I'm still working on it!


http://i.imgur.com/WBkM2QQ.png

Offline

 

#4 2008-12-19 14:38:31

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

Zooming != 3D



If you want 3D pick another language.

Also lucario, I think that your tutorial could be better. Try adding summaries of what the scripts do after you write out a script.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2008-12-19 14:41:27

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

archmage wrote:

Zooming != 3D



If you want 3D pick another language.

Also lucario, I think that your tutorial could be better. Try adding summaries of what the scripts do after you write out a script.

Well I just kinda got tired and after getting near the end I stopped....you know what I mean?


http://i.imgur.com/WBkM2QQ.png

Offline

 

#6 2008-12-19 14:43:38

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

Lucario621 wrote:

archmage wrote:

Zooming != 3D



If you want 3D pick another language.

Also lucario, I think that your tutorial could be better. Try adding summaries of what the scripts do after you write out a script.

Well I just kinda got tired and after getting near the end I stopped....you know what I mean?

You could always continue later.  wink


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2008-12-20 10:31:31

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: How to make a 3d ssb game for zawicki1fromyoutube

archmage wrote:

Lucario621 wrote:

archmage wrote:

Zooming != 3D



If you want 3D pick another language.

Also lucario, I think that your tutorial could be better. Try adding summaries of what the scripts do after you write out a script.

Well I just kinda got tired and after getting near the end I stopped....you know what I mean?

You could always continue later.  wink

I...I don't feel like it  wink

Last edited by Lucario621 (2008-12-20 10:32:05)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#8 2008-12-23 12:50:29

bubble-07
Scratcher
Registered: 2008-03-25
Posts: 17

Re: How to make a 3d ssb game for zawicki1fromyoutube

Umm... Look at my "smart camera" project... relates to this...

Offline

 

Board footer