Hello everyone , I’m making Game or in general I’m making educational game the way of the game is when the sprite bumped into the his group it will be hidden … OKEY that isn’t my problem . My problem is when the sprite bumped into anther sprite not the main sprite they will be over each other . Please . Help Me
What is the code for solution the problem ?
Hamza A.Marie
also called sprite cannibalism...
see here for a solution
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
Is the Sprite moving by dragging?
If so, this sample handles that …
In general, you have to test the other sprite to see if it is in a list of acceptable sprite components before doing anything with it.
That is very complex … I need a simple Code
Look at this Code …Are there any problems ??
I don't know what the sprites mean (bullets? targets? ...?)
so I can't know if it's right or wrong.
Why not test it and tell us?
I’m making the project with arabic language … I will send to you the picture of the sreen
When I move any object to the aim … The object bumped into any object and they get over each other … so What I can do … Please . I want to finish the project
Note :- the application in arabic language
We have told you the answer several times in this thread.
Post your exported .aia file here, so we can show you the fix.
Since we don’t read arabic, it is going to be a challenge.
Hello
Thanks for helping me .
this is the project in .aia file .
( I named the images into yes (it’s correct answer) and No (it isn’t correct) and the target into DO_that (go with Yes) and Don’t ( go with No)
Best wishes
thanks a lot
Covid_copy.aia (2.4 MB)
I see your app and you need two lists of file names:
- the image file names whose sprite should go into the YES sprite, and
- the image file names whose sprite should go into the NO sprite.
Post it as a comma separated value text, so it can be copied easily into a text block.
Aside from setting up the assignment of statement images to Sprites and the required lists of true and false statement images and their initial placements on the Canvas, here is my take on how to do drag and drop and to play appropriate sounds on drop. (I left out score, you can do that.)
(overview of all blocks in the game scrern)
Covid_ABG.aia (2.4 MB)
(exported .aia file)
function returning list of all draggable sprites by component
ditto for the two target sprites for yes and no
function to return which target sprite a dragged sprite has as a good landing
procedure to evaluate the drop choice made by a player
various globals needed for the dragging
You have to fill this in yourself, since I don’t know Arabic
the procedure that moves a sprite during drag. I fancied it up to drag by the center.
Touch Down is where we start a drag and settle on which sprite is being dragged and where it originated if we drop it in a fumble
Touch Up is how we drop sprites onto targets (or fumble them)
This procedure can figure out if a sprite is inside another sprite, good for target acquisition on drop.
This is where you list your NO answer files.
This might not be needed, My original project had sprites in a matrix, the same size.
This snaps a dragged sprite back to where it started. Good for a fumble or for a wrong answer.
This handles all drags. Oops, I should have called the procedure for dragging. You fix that, I’m running out of time.
This is the generic touchdown event.
If generic events are new to you, search the forum for ‘generic’
Hello @ABG
Thanks a lot for helping me
I tried the application and it isn’t working … So what Can I do ?
Please … Write soon If you can … Because I’m making this application for project
Best wishes
Hamza A.Marie
Am I supposed to do all of your project?
No . I’m begginer in app inventor so I want to learn app inventor !!!
I can't help you further until you answer my question.
I can't read Arabic, and
you won't read English?