Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Best Method To Draw The Same Sprite In More Than One Location?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 14th Dec 2017 22:03
Hi,

Made alot of progress, but still need to squeeze a little more performance in the game.
( Game demo is live on our site: www.16BitSoft.com )

We are designing a puzzle game with colored tiles.
What would be the best(fastest) method to draw the same sprite in more than one location?

The game's play area is 7x7 colored tiles.
Colors are: red, orange, yellow, green, blue, purple, and white and black (8 total).
Currently allocating 49 sprites of each color which is very bad for HTML5 performance.

So I would like to optimize the above, any suggestions?, thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
puzzler2018
User Banned
Posted: 14th Dec 2017 22:08
Take a look at the command

CloneSprite

This might be what you need to copy the sprite and properties


D

ps.. don't ever put createsprite or clonesprite in any main loops - but I think clonesprite is faster than createsprite
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Dec 2017 06:31 Edited at: 15th Dec 2017 06:33
If you don't need collisions etc the simplest way is just to use the drawsprite(name) command
an array could easily hold what is at each location

https://forum.thegamecreators.com/thread/221005
fubar
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 15:23
Hi,

"CloneSprite" was what we needed, URL above has been updated!
Thanks...
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!

Login to post a reply

Server time is: 2024-03-29 08:10:04
Your offset time is: 2024-03-29 08:10:04