Skip to first unread message

Mage Justice

unread,
Mar 7, 2019, 5:38:28 PM3/7/19
to MIT App Inventor Forum
Hi all,

I am having trouble getting the attached code to work. I really don't see why. Does anyone know how to fix this to make it work?

Mage Justice
Screen Shot 2019-03-07 at 5.36.46 PM.png

TimAI2

unread,
Mar 7, 2019, 5:56:12 PM3/7/19
to MIT App Inventor Forum
What doesn't work, all of it or some of it ?

You could try isempty block instead of the logic = block ?

Mage Justice

unread,
Mar 7, 2019, 7:52:05 PM3/7/19
to MIT App Inventor Forum
Ok thanks. On a side note, is there a way check the name of a sprite? For example all sprites that contain the word "wall" do something. I know there is a function in the text drawer for this, but can you actually detect the name of the sprite?

ABG

unread,
Mar 8, 2019, 11:15:58 AM3/8/19
to MIT App Inventor Forum
is there a way check the name of a sprite? 

You could code a result procedure is_a_wall taking a sprite component for input,
that returns the is in list lookup result of a hand coded
make list of all the sprite components for walls .

ABG 

Mage Justice

unread,
Mar 8, 2019, 2:24:39 PM3/8/19
to MIT App Inventor Forum
Thanks. What I did was check for the size of the sprite, and if the width is a certain amount, let's say 25 pixels, then it calls a procedure. Then in the procedure, I check if the picture matches a certain picture in the system to check and see what sprite it is. Finally, once the program knows what it is, it can carry out operations based on the sprite. Thanks so much!

One more small thing: for some reason a png file turns blurry when I expand the resolution, but it is pixelated, a 32x32 picture. How do I keep the pixels sharp when I greatly increase the size of the image?

TimAI2

unread,
Mar 8, 2019, 2:36:34 PM3/8/19
to mitappinv...@googlegroups.com
You probably won't have much luck with increasing the view of a 32x32 image
Create a higher resolution image and use that instead ?
Or do some serious graphics work on your small images....

Mage Justice

unread,
Mar 8, 2019, 2:46:26 PM3/8/19
to MIT App Inventor Forum
Thanks everyone!
Reply all
Reply to author
Forward
0 new messages