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

#1 2012-12-01 18:02:19

fillergames
Scratcher
Registered: 2012-10-15
Posts: 1000+

Making objects load when far from the player.

Im trying to remake the original super mario bros on scratch. sence its one way scrolling. If i made the ememys stop scripts if far from the player to reduce lag. Is this possible?


http://i50.tinypic.com/2ufvxc5_th.gif Grammer? Whats grammar?

Offline

 

#2 2012-12-02 13:35:29

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Re: Making objects load when far from the player.

You could use the wait until block and make it so that it will wait until the distance between them is a certain amount before they do anything

Offline

 

#3 2012-12-02 14:42:29

Johndl
Scratcher
Registered: 2012-11-26
Posts: 24

Re: Making objects load when far from the player.

you could have something like:

forever
IF scrollx of ENEMY < scrollx of PLAYER - 150:
hide
stop script
IF scrollx of ENEMY > scrollx of PLAYER + 150:
hide
ElSE show

The 'stop script' part is to prevent lag. If you wanted to be really efficient, you count only have 1 sprite and keep reusing it.

Hope this helps

Offline

 

#4 2012-12-03 20:47:25

fillergames
Scratcher
Registered: 2012-10-15
Posts: 1000+

Re: Making objects load when far from the player.

Johndl wrote:

you could have something like:

forever
IF scrollx of ENEMY < scrollx of PLAYER - 150:
hide
stop script
IF scrollx of ENEMY > scrollx of PLAYER + 150:
hide
ElSE show

The 'stop script' part is to prevent lag. If you wanted to be really efficient, you count only have 1 sprite and keep reusing it.

Hope this helps

Thanks. Now to start working on it.


http://i50.tinypic.com/2ufvxc5_th.gif Grammer? Whats grammar?

Offline

 

Board footer