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

#1 2012-08-12 10:40:01

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Game problem

OK, so i started my new game, but have problems with creating gravity, water, etc.
PLEASE HELP!

Offline

 

#2 2012-08-12 10:49:31

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Game problem

spiderwes wrote:

OK, so i started my new game, but have problems with creating gravity, water, etc.
PLEASE HELP!

Realistic water is incredibly hard, but gravity is easy, it really depends on what you need. what kind of project is it

Last edited by zammer990 (2012-08-12 10:49:52)


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-08-12 10:58:59

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

it's a platform game, like mario

Offline

 

#4 2012-08-12 11:17:21

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Game problem

spiderwes wrote:

it's a platform game, like mario

If that's the case, then you probably want velocities ,and if you just want the character to slow down in water, not for the water to move, then you should use a colour sensor

when gf clicked
forever
if <key [right arrow v] pressed?> //for all the movement keys
change [xvel v] by (1)
end
if <key [up arrow v] pressed?>
set [yvel v] to (7)
end
if <not<touching color (ground colour)?>>
if <(yvel) < (1)>
change [yvel v] by (-1)
else
set [yvel v] to ((yvel) * (0.87))
end
if <touching color (ground colour)?>
set [yvel v] to (0)
end
if <touching color (water colour)?>
set [maxspeed v] to (2)
else
set [msxpreed v] to (3)
end
if <(xvel) > (maxspeed)>
set [xvel v] to (maxpeed)
end
change x by (xvel)
change y by (yvel)
set [xvel v] to ((xvel) * (0.87))
this doesn't allow swimming. but gives you the basics


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#5 2012-08-12 11:21:24

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

ok, thanks!

Offline

 

#6 2012-08-12 11:28:50

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

and this is under sprite?

Offline

 

#7 2012-08-12 11:54:08

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

thanks it works and is awesome!

Offline

 

#8 2012-08-12 12:05:06

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

how do i make it so my sprite can only go so high when jumping?

Offline

 

#9 2012-08-12 15:11:15

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Game problem

spiderwes wrote:

how do i make it so my sprite can only go so high when jumping?

Use a variable "jumping" and have it so when you jump, it sets jumping to 1, and have it so you cant jump while jumping is 1, have jumping reset when you hit the ground


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#10 2012-08-12 17:37:31

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

ok where do i put that?

Offline

 

#11 2012-08-12 19:07:39

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Game problem

spiderwes wrote:

ok where do i put that?

if <key [up arrow v] pressed?>
if <(jumping) = (0)>
set [yvel v] to (7)
set [jumping v] to (1)
end
end
if <touching color (ground color)?>
set [jumping v] to (0)

Last edited by zammer990 (2012-08-12 19:07:50)


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#12 2012-08-13 08:46:35

spiderwes
New Scratcher
Registered: 2012-08-12
Posts: 96

Re: Game problem

ok thnx again

Offline

 

Board footer