Setting the image sprite position on a different screen

82 views
Skip to first unread message
Assigned to scottfr...@gmail.com by me

appinvento...@gmail.com

unread,
Feb 24, 2014, 12:54:54 PM2/24/14
to mitappinv...@googlegroups.com
Hello! I'm very new here and I've looked in the forums for a similar problem but I can't seem to find any (and I couldn't find a tutorial that could help me).

Problem: What I'm trying to do is when you click on a button, it will take you to another screen (a drawing canvas), and depending on which button is pressed on the previous screen, the image sprites will have a set position/location on the canvas.
How does one set the position of the image sprites that's on a different screen (and based on the button that is pressed on the previous screen)?

By the way, all the buttons (there are 20+) will have 10 sprite images (all the same image) that are set to different positions on the canvas when the button is pressed.

After I implement this code, I might try to include a scoring system that will display how many sprites are hit when the user draws and touches them, but I'm stuck on this seemingly simplistic problem. Any help would be appreciated, thanks!

Hal Abelson

unread,
Feb 27, 2014, 9:50:50 PM2/27/14
to mitappinv...@googlegroups.com
You can't do exaclty what you want but ..

- you can switch to another screen with OpenAnotherScreen .  See the ColoredDots tutorial.
- you can arrange to various commands (like setting sprite positions) to be executed when a screen opens.

Scott Ferguson

unread,
Feb 28, 2014, 10:35:25 PM2/28/14
to

Revised 14-01-28 9:34pmCST - replaced list from csv row with list from csv table


Two buttons on Screen1:




Two ImageSprites on Screen2:

---

Scott

MoveImageSpritesOtherScreen.aia

Taifun

unread,
Feb 28, 2014, 12:31:04 PM2/28/14
to mitappinv...@googlegroups.com
@Scott: probably better to use the list from csv table block instead?
Taifun



Scott Ferguson

unread,
Feb 28, 2014, 10:35:57 PM2/28/14
to
Thanks - just fixed it.
---
Scott

SH

unread,
Mar 1, 2014, 11:21:35 PM3/1/14
to mitappinv...@googlegroups.com
Scott Ferguson,

Thanks a lot to you and everyone who replied! I'll check and see if this works with my program. I'll post the results on Monday at most. 

SH

unread,
Mar 4, 2014, 12:07:44 PM3/4/14
to
I did exactly what's in the pictures, but for some reason, it doesn't work for 10 of them. It works alright with only two sprites, just like the one Ferguson posted. But it's alright we decided to go in a different direction, but thanks anyways!

EDIT: I found out it works better on a phone. The emulator has problems not showing their positions.
Reply all
Reply to author
Forward
0 new messages