When your game runs slow it is normally due either to the use of scripts or because you are drawing
a lot of images in each step. Concerning graphics, take the following into account:
Use particles when possible.
If possible simply let GameMaker draw the instances by assigning the correct sprite to them.
If you draw the instances yourself by defining the Draw event this is normally slower (but
more flexible, so if you need it for your game, you should of course use it).
Try to avoid redrawing the same area multiple times. For example, you could put button
images already on the background image and only define a virtual key area (see below). And
if you have multiple layers of backgrounds or borders, only draw the parts that are actually
visible.
Split large images with a lot of transparent areas into sub-images that together are smaller.
E.g. if you have a border around your playfield, don’t use one large image that is transparent
in the middle but use four separate images instead. (Of course, don’t exaggerate. If you split
an image in 20 sub-images it will probably become slower again.
Avoid a lot of text (text drawing means the drawing of many separate images, one for each
letter).
05:21
Administrator


0 comentarii:
Trimiteți un comentariu