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

#1 2012-09-21 18:23:12

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

platformer help

I made this platform game that was pretty good but at first it was too long to upload and was jerky. So I reduced its size a lot but it still won't perform well. It's because of a scene change problem.

When my character touches the edge he's teleport to the opposite side of the screen and the scene changes to the next one. This way he's not on the same side he was before. There is a lag before it changes but it doesn't matter when changing x.

But when my character falls down to the edge or hops up to the edge, because of the lag it messes up and doesn't change the scene fast enough. As a result my character changes its y position before the scene changes into the next. It will work for the first fall but otherwise it messes up my character and it ends up touching both sensors which teleports my character from top to bottom over and over again. I need a good programmer to find a fix for this: here is the link http://scratch.mit.edu/projects/bullelk12/2792796

Last edited by bullelk12 (2012-09-21 18:27:13)


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#2 2012-09-21 18:25:35

jamiewinter
Scratcher
Registered: 2012-08-19
Posts: 100+

Re: platformer help

ok ill try


Check out my youtube channel http://www.youtube.com/user/axelregulator/featured

Offline

 

#3 2012-09-21 18:30:10

jamiewinter
Scratcher
Registered: 2012-08-19
Posts: 100+

Re: platformer help

err there isnt lag it may be your client but
the bug where you fall then go to the ceiling happened once

try making it so when you go down
you fall next room not on the ground but not at the top
slightly under the top so you cant hit the sensors


Check out my youtube channel http://www.youtube.com/user/axelregulator/featured

Offline

 

#4 2012-09-21 18:31:41

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: platformer help

That's probably it! I do have him do that but maybe not enough. thx.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#5 2012-09-21 18:33:13

jamiewinter
Scratcher
Registered: 2012-08-19
Posts: 100+

Re: platformer help

thats ok


Check out my youtube channel http://www.youtube.com/user/axelregulator/featured

Offline

 

#6 2012-09-21 21:33:19

125ttra
Scratcher
Registered: 2011-12-17
Posts: 27

Re: platformer help

Did you find the fix yet?

Offline

 

#7 2012-09-22 13:28:55

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: platformer help

yep, it worked.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#8 2013-01-19 03:13:06

WIlliam7777
Scratcher
Registered: 2012-07-21
Posts: 41

Re: platformer help

Here is the script:
Don't worry my scripts have velocities.


when gf clicked

set [xvl v] to [0]

set [yvl v] to [0]

forever  

switch to costume [sensor v]

if <color [#0042FF] is touching [#000008]?> 

set [yvl v] to [0.1]

end

if <key [up arrow v] pressed?> 

if <color [#0042FF] is touching [#000008]?> 

set [yvl v] to [15]

end

end

if <color [#FFFF00] is touching [#000008]?> 

set [yvl v] to [-2]

end

if <key [right arrow v] pressed?> 

change [xvl v] by (1)

if <color [#00FF52] is touching [#000008]?> 

set [xvl v] to [-1]

end

end

if <key [left arrow v] pressed?> 

change [xvl v] by (-1)

if <color [#FF0000] is touching [#000008]?> 

set [xvl v] to [1]

end

end

set [xvl v] to ((xvl) * (0.9))

change x by (xvl)

change y by (yvl)

switch to costume [ball v]

change [yvl v] by (-1)

end

Hope this works.

Offline

 

#9 2013-01-19 03:15:25

WIlliam7777
Scratcher
Registered: 2012-07-21
Posts: 41

Re: platformer help

bullelk12 wrote:

I made this platform game that was pretty good but at first it was too long to upload and was jerky. So I reduced its size a lot but it still won't perform well. It's because of a scene change problem.

When my character touches the edge he's teleport to the opposite side of the screen and the scene changes to the next one. This way he's not on the same side he was before. There is a lag before it changes but it doesn't matter when changing x.

But when my character falls down to the edge or hops up to the edge, because of the lag it messes up and doesn't change the scene fast enough. As a result my character changes its y position before the scene changes into the next. It will work for the first fall but otherwise it messes up my character and it ends up touching both sensors which teleports my character from top to bottom over and over again. I need a good programmer to find a fix for this: here is the link http://scratch.mit.edu/projects/bullelk12/2792796

Want?Here it is!


when gf clicked

set [xvl v] to [0]

set [yvl v] to [0]

forever  

switch to costume [sensor v]

if <color [#0042FF] is touching [#000008]?> 

set [yvl v] to [0.1]

end

if <key [up arrow v] pressed?> 

if <color [#0042FF] is touching [#000008]?> 

set [yvl v] to [15]

end

end

if <color [#FFFF00] is touching [#000008]?> 

set [yvl v] to [-2]

end

if <key [right arrow v] pressed?> 

change [xvl v] by (1)

if <color [#00FF52] is touching [#000008]?> 

set [xvl v] to [-1]

end

end

if <key [left arrow v] pressed?> 

change [xvl v] by (-1)

if <color [#FF0000] is touching [#000008]?> 

set [xvl v] to [1]

end

end

set [xvl v] to ((xvl) * (0.9))

change x by (xvl)

change y by (yvl)

switch to costume [ball v]

change [yvl v] by (-1)

end

Offline

 

Board footer