2017년 7월 17일 월요일

Resetting sprite back to visibile


I created a game that when a ball sprite stricks a series of twenty blocks (sprites) it set the blocks' visibility to false. I need a way for the game to end when every one of the blocks' visibility is set to false.

I've trie a twenty layered if then statement, but it must be flawed because it didn't work. Any ideas?

--
Make a value procedure that returns a list of all the block sprite components, called all_blocks.

The component blocks are the last block in the drawer for each component.

Look in the Blocks pallete for the Any Sprite branch at the end.
Those are the blocks you can use with components.

To test if all 20 blocks are invisible, 

set global invisible_block_count to 0
for each block in all_blocks()
   if not(Any Sprite.Visible(block)) then
        set global invisible_block_count to 1 + global invisible_block_count 
(end if)
(end for each)
if global invisible_block_count = length of list(all_blocks()) then
   (all the blocks are invisible)



-- 
Thanks for the direction. I creatd a block, but not getting response when I call the procedure. Can you provide guidance where I need to place the call procedure to get it end game.



-- 
See this doc for examples of how to keep a list of sprites, and traverse it ...  Drag and Swap Puzzles in JSON

Your comparison was wrong.  It should check invisibility of item.

Regarding your blocks, the procedure you coded should be named check_count,
because that's what it tries to do.

See my all_sprites procedure in the doc for an example of a procedure worthy of the name all_blocks.


-- 

How to make my app to autoupdate without using Google play


I have made an app for my online radio station, the problem is that i whant to make some changes on the app (news, streaming url) and every time i have to tell users to download the new version of the app, how can i make the app to autoupdate when i make those changes?
Just like are all the apps on google play, when they modify something on the app i get an message on my phone that there is a new version and i have to update it.
I have to say that i am a begginer in this, can someone please explain how to do that without using google play service, i have the website of the radio where i can upload the app, my app is not for comercial use so i do not ask users for money to download it !!!

--
use a server database (for exampe a fusiontable) to store the version number on each run of the app check that version number and if there is a newer version available, then download the new version for example from your Google Drive

the easier way would be to use Google Play...

--
Thanks a lot, i will try it !!!

-- 

App Inventor 1101 Error - Unable to get a response with specified URL






--
Even I was facing the same issue with app inventor. I tried deleting the Web Client and re-adding. It works for me.

This is a bug in app inventor and nothing wrong with the web response getting.


If you need any help feel free to contact me .

+94702758031 - Viber or Whatsapp for urgent help!

-- 

Problems How i can make a list with words that includes values?


Can someone help me with these to problems:
1) How can I make a list with words that includes values? For example when I choose "A" from the list it has value of 1 in a calculation and when I choose "B" it has value of 2 etc.
2) How can I copy calculation result from one screen to another?

--
1) Two lists:

A,B,C,D,E
1.2.3.4.5

Get index selected from first list, then get corresponding index from the second list to use in calcualtion

2) Use a tinydb to save data that is accessible across screens, or make the calculation result the "start value" for the next screen.

-- 
Can you give step by step instruction with problem no 1?

--
that was the step by step instruction... ;-)

it seems to be, you are not very familiar with the basics?
see here

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also 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

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

--
Here is a quick howto with aia attached  ;) (@ Taifun, I must be getting soft in my old age :) )



-- 

Move between images at the same screen ?


how to move between 3 images at the same screen by moving your finger from left to right ?

--
Thanks .and if i want to make page folding pattern .is it possible ?

-- 
what is a "page folding pattern"? you might want to elaborate...

-- 
like this
--
probably you can do it using the webviewer and some HTML/JavaScript, this library http://www.turnjs.com might work...
5396f77366f55-turnjs4.zip

see some HTML/JavaScript examples using App Inventor here https://puravidaapps.com/tutorials.php#html
-- 
can you check those block please .i think there's something wrong


-- 

PizzaParty example is returning /sdcard/AppInventor/assets: open failed: EISDIR


I tried to execute the PizzaParty example given by app inventor. I followed all the instructions and keep getting the message:

/sdcard/AppInventor/assets: open failed: EISDIR (Is a directory)

/sdcard/AppInventor/assets/<your keyfile name>: open failed: ENOENT (No such file or directory)

I looked around and found some examples given by Taifun explaining there could be a conflict between API key and user service authentication. To reset all i deleted my service account and created a new one from scratch, I also created a new table but still getting the same message.

I did not forget to upload the new *.p12 file and to change the service account email, but still the same message. Any help?


Block look like as attached while the rest is the original example with no change

DataBase also looks like as attached

And also service account setting is as attached

Any idea how can I get out of this loop will be mostly appreciated







--
did you upload the keyfile into the assets of the app?

The key file you mean the file with extension p12? If so, yes I did upload it

And I also created the service account key as in your guide. I think I showed it with one of the attachments I put here.

BTW, I did this process two times today while deleted and re-created and still facing the same error message

-- 
see also chapter 5 How to create a Service account for Fusiontables

When you create your app, you’ll need to copy and paste the service account email address into the ServiceAccountEmail property of the Fusion Tables component in App Inventor.
You’ll also need to upload the key file as media into App Inventor. In the Fusion Tables component properties, select the KeyFile to the file you uploaded.
You’ll use these in setting up the FusiontablesControl component in your app.  You’ll need to
check the UseServiceAuthentication option in the component properties. It should look like this:


-- 
The problem was not the missing key file name in the properties but the service account email which should also be added manually for some reason.

I have no idea why it should be mentioned twice one in the properties and one as the variable in the blocks session, but as I did so it worked so all I have is to thank you again

--