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

#1 2013-03-10 11:08:20

hrscratches
Scratcher
Registered: 2013-01-03
Posts: 2

3D Games

I cant seem to make a 3d game. I tried making it so if up arrow pressed, change size, right arrow change x, blah blah blah. Everything I try has a glitch. Can anyone help?

Offline

 

#2 2013-03-10 11:43:48

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: 3D Games

can you post your project online so i can have a closer look?


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#3 2013-03-10 11:51:01

streamline4
Scratcher
Registered: 2013-02-17
Posts: 3

Re: 3D Games

can you also show me, too?

you can use scratchblocks also

-streamline4  smile

Offline

 

#4 2013-03-24 15:32:23

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: 3D Games

i'm new to this and to scratchblocks, but this is what i would do. uses WASD keys for movement.

***It has a bug I don't know how to fix though: if i press two keys at once one of the keys will remain locked down until you press it again, not sure why.

when gf clicked
set size to (100)%
set [depth v] to (0)
set x to (0)
set y to (-200)
forever
   set size to ((100) - ((depth)/(4))) %
   set y to (((10) *  ([sqrt v] of ((1)+(depth)))) - (100))
   if <key [w v] pressed?>
      change [depth v] by (3)
      if <(depth) > (200)>
         set [depth v] to (200)
      end
   end
   if <key [s v] pressed?>
      change [depth v] by (-3)
      if < (depth) < (0)>
         set [depth v] to (0)
      end
   end
   if < key [a v] pressed?>
      change x by (-3)
   end
   if <key [d v] pressed?>
      change x by (3)
   end
you'll have to define a variable "depth" for your sprite.

Offline

 

#5 2013-03-24 15:35:48

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: 3D Games

actually you don't need the

set y to [-200]
it doesn't do anything

Offline

 

#6 2013-03-24 19:56:30

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: 3D Games

update: this bug has been bothering me for a while but turns out it only exists on my computer. when i post things online they work. so i think the code posted above should work for you. nm about the bug.

Offline

 

#7 2013-03-26 00:45:31

Aqibaslam123
Scratcher
Registered: 2013-01-28
Posts: 72

Re: 3D Games

Hey Everyone check out my game it's 3D u can check the scripts to help you I still can't understand how It worked. but u can check it. it's here:-
http://scratch.mit.edu/projects/Aqibaslam123/3206807


Experience Real car racing here now with save and load system!!
http://scratch.mit.edu/projects/Aqibaslam123/3206807

Offline

 

#8 2013-03-29 09:51:44

Liamadams
Scratcher
Registered: 2012-12-08
Posts: 100+

Re: 3D Games

cauzality wrote:

i'm new to this and to scratchblocks, but this is what i would do. uses WASD keys for movement.

***It has a bug I don't know how to fix though: if i press two keys at once one of the keys will remain locked down until you press it again, not sure why.

when gf clicked
set size to (100)%
set [depth v] to (0)
set x to (0)
set y to (-200)
forever
   set size to ((100) - ((depth)/(4))) %
   set y to (((10) *  ([sqrt v] of ((1)+(depth)))) - (100))
   if <key [w v] pressed?>
      change [depth v] by (3)
      if <(depth) > (200)>
         set [depth v] to (200)
      end
   end
   if <key [s v] pressed?>
      change [depth v] by (-3)
      if < (depth) < (0)>
         set [depth v] to (0)
      end
   end
   if < key [a v] pressed?>
      change x by (-3)
   end
   if <key [d v] pressed?>
      change x by (3)
   end
you'll have to define a variable "depth" for your sprite.

You can also do it with arrow keys

when gf clicked
set size to (100)%
set [depth v] to (0)
set x to (0)
set y to (-200)
forever
   set size to ((100) - ((depth)/(4))) %
   set y to (((10) *  ([sqrt v] of ((1)+(depth)))) - (100))
   if <key [up arrow v] pressed?>
      change [depth v] by (3)
      if <(depth) > (200)>
         set [depth v] to (200)
      end
   end
   if <key [down arrow v] pressed?>
      change [depth v] by (-3)
      if < (depth) < (0)>
         set [depth v] to (0)
      end
   end
   if < key [left arrow v] pressed?>
      change x by (-3)
   end
   if <key [right arrow v] pressed?>
      change x by (3)
   end
And i have to admit, that was an epic first try on the scratchblocks and it worked  big_smile  i'm proud of that  smile


http://i39.tinypic.com/3309476.jpg

Offline

 

#9 2013-03-30 14:19:23

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: 3D Games

i made an example project with this code
http://scratch.mit.edu/projects/cauzality/3221504

Offline

 

#10 2013-03-30 17:12:43

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: 3D Games

Aqibaslam123 wrote:

Hey Everyone check out my game it's 3D u can check the scripts to help you I still can't understand how It worked. but u can check it. it's here:-
http://scratch.mit.edu/projects/Aqibaslam123/3206807

Please go to the Show and Tell area of the Forums to advertise your projects


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#11 2013-03-30 17:20:49

MoreThanOneLetter
New Scratcher
Registered: 2013-03-30
Posts: 54

Re: 3D Games

7734f wrote:

Aqibaslam123 wrote:

Hey Everyone check out my game it's 3D u can check the scripts to help you I still can't understand how It worked. but u can check it. it's here:-
http://scratch.mit.edu/projects/Aqibaslam123/3206807

Please go to the Show and Tell area of the Forums to advertise your projects

They were trying to help hrscratch with 3D by showing an example project.

Offline

 

Board footer