federico masseroni

unread,
Jun 22, 2015, 1:47:23 PM6/22/15
to mitappinv...@googlegroups.com
Here is an example of what i mean:

I want to make a starship to shoot bullets every time i touch it, but i don't want to add thousands of bullet sprites in the canvas...

Is there a way to spawn the same sprite after an event occurs? I don't mean making the sprite invisible, changing its position and make it visible again; it has to appear multiple times at once.


SteveJG

unread,
Jun 22, 2015, 4:28:24 PM6/22/15
to mitappinv...@googlegroups.com
How many spaceships/bullets do you need?  With App Inventor, you  need an Image Sprite for each spaceship and bullet you want to display on the screen at the same time.  The picture you use in each sprite can be the same --you do not need to load dozens of images.     For a sprite to displlay multiple times simultaneously, you need multiple sprites

Thousands of bullet sprites? There isn't enough space on a Canvas to do that!.

App Inventor cannot dynamically create objects (which is what a sprite is).  What you do is add is add as many bullets or spaceships as you need and hide them until you need them.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages