Skip to first unread message

elni...@gmail.com

unread,
Sep 11, 2014, 12:41:43 AM9/11/14
to mitappinv...@googlegroups.com
Hi!

1) If I have for example....100 sprites and I want to put them in a list.
Is there any way not do it one by one?

Once I have the 100 sprites in the list, I need to collide them with a single sprite (that shouldn't be in the list).

2) Also, which is the highest number of sprites that an app allows in app inventor? And in a list?

Thanks!
Regards.

Stephen Zipprich

unread,
Sep 11, 2014, 1:04:59 AM9/11/14
to mitappinv...@googlegroups.com
1) If I have for example....100 sprites and I want to put them in a list.
Is there any way not do it one by one?


Nope, you have to add each one to the list in order to use the Advanced Blocks to detect your collisions.
 
Once I have the 100 sprites in the list, I need to collide them with a single sprite (that shouldn't be in the list).


I don't know what this means.
 
2) Also, which is the highest number of sprites that an app allows in app inventor? And in a list?


In AI Classic, you could have a maximum of 50 items in a list.  I'm not sure whether this limitation exists in AI2...perhaps someone else can chime in on that one.

Taifun

unread,
Sep 11, 2014, 10:19:40 AM9/11/14
to mitappinv...@googlegroups.com
concerning the maximum number of items in a list: as far as I know, there was no such limitation in AI Classic and there is also no limitation in App Inventor 2

but the question is, does it really make sense to have 100 sprites the same time on your screen?
I think, this will be too much for the app and it will be very slow, but that's just a guess
I recommend you to reuse your sprites!
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Ghica

unread,
Sep 11, 2014, 10:22:43 AM9/11/14
to mitappinv...@googlegroups.com
- Once I have the 100 sprites in the list, I need to collide them with a single sprite (that shouldn't be in the list).

If you want to detect collision occurring, then what you probably want is use when (singleImageSprite).CollidedWith, which gives you "other"as input. You could then go through your list to find out which imagesprite is the other. And if you found it, do something.
Cheers, Ghica.

elni...@gmail.com

unread,
Sep 11, 2014, 11:06:54 AM9/11/14
to mitappinv...@googlegroups.com
Thanks to everyone!

This is what I need:

I have a "moving sprite" (it is moving all the time without pause).
I want to "cover" the canvas with sprites in the shape of a square (all of them are equal).

When the moving sprite collide with any of them, the sprites should disappear.

I need to have about 700 sprites in the canvas.

Is this possible?

Thanks!
Regards.

Taifun

unread,
Sep 11, 2014, 11:21:53 AM9/11/14
to mitappinv...@googlegroups.com
how many sprites do you want to display the same time?
Taifun

elni...@gmail.com

unread,
Sep 11, 2014, 11:26:53 AM9/11/14
to mitappinv...@googlegroups.com
About 768 square sprites, all at the same time.

That is common "arkanoid" game.
Just the ball, the pong and the bricks (768 bricks).

Thanks.

Taifun

unread,
Sep 11, 2014, 11:43:20 AM9/11/14
to mitappinv...@googlegroups.com
well, 768 different sprite components is a lot
I recommend you to start with lets say 50 and if you get this working, then add another 50 etc.: do it step by step...
Taifun

elni...@gmail.com

unread,
Sep 11, 2014, 12:19:16 PM9/11/14
to mitappinv...@googlegroups.com
OK I''ll try that.

One more question:

Let's say I have all the square sprites called "ImageSpriteX", with X = 1..768, right?

Can I do something like this?

Add to the list "allSquareSprites" every item that contain the text "ImageSprite"??

Is this possible??

Thanks!

Taifun

unread,
Sep 11, 2014, 1:01:33 PM9/11/14
to mitappinv...@googlegroups.com
yes you can
first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

also take a look at how the advanced blocks work, here is an example

elni...@gmail.com

unread,
Sep 11, 2014, 2:51:13 PM9/11/14
to mitappinv...@googlegroups.com
OK, I checked that tutorials, but I still cannot relate that with my specific problem.

Please see my printscreen example.

Thanks :)

spriteList.png

Taifun

unread,
Sep 11, 2014, 3:55:25 PM9/11/14
to mitappinv...@googlegroups.com
no that's not possible
for each sprite you have to add its component, which is the last one in the list of blocks
again: see how the advanced blocks work, here is an example
Taifun
Reply all
Reply to author
Forward
0 new messages