Game Maker's Garage Forum

Game Creation => SilverCreator => Topic started by: WarHampster on October 30, 2010, 08:58:13 PM

Title: SC Reminder
Post by: WarHampster on October 30, 2010, 08:58:13 PM
Reminder to all SilverCreator programmers: ALWAYS make use of the extra boolean parameter on sprite commands. For example, MOVESPRITE 1,x,y should be MOVESPRITE 1,x,y,1.

From the SC manual:

Quote
updateScreen Parameter

Explanation

This is an optional parameter available on most sprite commands. When you pass TRUE to this parameter, the runtime will suppress the next screen update.

Each use of a sprite command causes an immediate screen update, reflecting the changes caused by the command. While this makes simpler games easier to code, sometimes this is not desirable for speed or aesthetic purposes.

Examples

// When you run this code, you will see each sprite briefly
// as it is transformed by each sprite command.
CREATESPRITE 1, "rocket"
MOVESPRITE 1, 50, 50
SCALESPRITE 1, 75
TINTSPRITE 1, 35, 35, 35, 50

// When you run this code, you will only see the final
// transformed sprite. This code will also run faster.
CREATESPRITE 1, "rocket"
MOVESPRITE 1, 50, 50, TRUE
SCALESPRITE 1, 75, TRUE
TINTSPRITE 1, 35, 35, 35, 50   // we don't put TRUE here, which causes the screen to update

Related Items

None.

Forgetting to tell SC to wait to update the screen will in most cases result in terrible lag!
Title: Re: SC Reminder
Post by: Silverwind on October 31, 2010, 04:08:09 AM
Awesome. In GM we set the sprout's layer to a negative value and the sprite(s) won't update the screen untill a positive value layered sprite is drawn.

EDIT:

LOL! Sprout's? Ruddy iPhone...
Title: Re: SC Reminder
Post by: Charlo on October 31, 2010, 04:17:26 PM
This feature is especially useful for level rendering.  Seeing all the sprites of the level appear one at a time over the course of a half-second isn't very good-looking.  ;)
Title: Re: SC Reminder
Post by: GMG Mike on November 01, 2010, 10:50:57 PM
I might make it a checkbox in future versions, for all sprite commands to assume TRUE for the extra boolean parameter unless you specifically say FALSE. This would be a per-project checkbox.
Title: Re: SC Reminder
Post by: Connors on November 02, 2010, 07:58:31 PM
Sounds good to me, that would keep the feature in but make things easier for when you dont need it