Two last issues before finishing app!

Hi everyone,
I almost finished my app, two last technical issues to tackle:
1. (see attachment) The screen in my app is scrollable. The user needs to place flowers on the fence. Everything works nicely, however once the flowers are on the fence they should stay on their spot relative to the fence when you drag the screen. The user should still be able to (re)move the flower from the fence, but when he or she slides the screen, the flowers on the fence should remain static, just like the fence.
Because the flowers are actually spawned actors they don't appear in the 'layers' screen, so I cannot put them in an unscrollable layer.
2. The fence is made of separate bars. The user should be able to reduce the amount of bars so the fence gets the right lenght. (it functions as a scoreboard) I tried creating an actor that removes the bars but this does not work the way I want to. I then tried 'change image': when you touch a bar it is replaced by an image of a white (therefore invisible) bar. However, because GameSalad puts the actors in boxes sightly bigger than the actor itself, this does not work: when you change the image, more than one bar is removed.
Hope you can help!
My app:
http://www.mediafire.com/?o21dvb7vko2xqau
I almost finished my app, two last technical issues to tackle:
1. (see attachment) The screen in my app is scrollable. The user needs to place flowers on the fence. Everything works nicely, however once the flowers are on the fence they should stay on their spot relative to the fence when you drag the screen. The user should still be able to (re)move the flower from the fence, but when he or she slides the screen, the flowers on the fence should remain static, just like the fence.
Because the flowers are actually spawned actors they don't appear in the 'layers' screen, so I cannot put them in an unscrollable layer.
2. The fence is made of separate bars. The user should be able to reduce the amount of bars so the fence gets the right lenght. (it functions as a scoreboard) I tried creating an actor that removes the bars but this does not work the way I want to. I then tried 'change image': when you touch a bar it is replaced by an image of a white (therefore invisible) bar. However, because GameSalad puts the actors in boxes sightly bigger than the actor itself, this does not work: when you change the image, more than one bar is removed.
Hope you can help!
My app:
http://www.mediafire.com/?o21dvb7vko2xqau
Best Answer
-
jckmcgraw Posts: 647
@liefkees
EDIT: Did you publish a separate file for your game? Because it does not look done
As for the flower aspect, you are going to have to re-think the drag onto the fence, because there is no way to change a layer real time. However, you could work some magic with attributes. Create 3 boolean attributes named for each of the 3 flowers, and have them all set to false. Create a control actor that is above the fences in the background layer.
When one of the flowers is touched, change its respective attribute to true. In the control, when one of those is true, spawn it at the position that the flower you touch is and after 0.1 sec, change it back to false.
This way, since the control actor is spawning it, it can be on top of the fence, and the flowers will move with the background.
As for the fences, I can't quite understand what you are trying to explain...
Hope this helps,
Jack McGraw
Answers
Thanks for your answer.
I only attached the part of the app that I have questions about.
My apologies for the confusion regarding the fence. What I meant to say is that the user should be able to delete parts of the fence, making it shorter.
As for the attributes: sounds complicated! I will try to figure it out though.
Thanks again,
Maaike
Regarding the attributes, if what I said isn't quite clear enough, i can make a quick demo for you.
Regarding the fence, I didn't look specifically at the fences' code, but if there isn't too much code and such, I would recommend simply deleting it and starting over.
What I did notice is that the actor's size looked much bigger than the actual image, and that actors may have overlapped, which might cause some problems.
Hope this helps,
Jack McGraw
P.S. if you mention my username (@jckmcgraw), I can respond much quicker because I will be notified via email.
Hi Jack,
Thanks for the reply.
I fear I can't figure out your advice regarding the attributes. So a quick demo would be great. Are you sure though that with the solution recommended by you users can place the flowers anywhere they want on the fence?
I will quickly explain the goal of my app: it is made for children who are limited in their daily activities due to illness or disability. Medical rehabilitation centers use a method for this where the children get a personalized score: My toddler, for example, can 'score' 23 points a day (where a light activity is 1 point, medium 2 points and heavy activity 3), if he does more than this he will get pain. (a healthy child can easily score 50-60 points a day) Because it is difficult to keep track of the activities of your child during the day I created this app. Children or the parents can drag the points (flowers in 3 sizes, representing the activities) to the fence. If the fence is full (in my child's case this means any combination of flowers, leading to 23 points, represented by 23 bars) my child should rest.
As each day is different and each child will have a different score, I need the fence (each bar representing one point) to be adjustable for the user. Ideally the user could set the score in a drop down menu, changing the length of the fence to the selected number of bars. As I have no idea how to do this I chose to simply display the maximum amount of bars, and have the user remove the bars to reach their desired score. However, just as you mentioned, this doesn't work either because the actor's size is bigger than the image, so they overlap and more than one bar is being removed.
I would have given up on building the app if it wasn't so important for me to have the app for helping my child rehabilitate. So I am very glad this forum exists.
Thanks in advance for your help!
Maaike
Sorry for the late reply, but I have been busy lately, and am finishing up my first app to publish. School and sports are a time hog. The reason you are making this app seems really cool! I'm glad you haven't quit.
I still haven't had time to make the demo, but it is on my todo list! Hopefully I can get around to it in the next couple of days.
Regards,
Jack McGraw
I mentioned trying to do that in one of my earlier comments on this thread.
Jack McGraw
@pixlepix thanks for the advice
EDIT:
Sorry it took so long, but I am have finished the demo. One thing that you will have to fix yourself is to make the fence size smaller (but leave the appearance the same) so that none of the fences overlap with each other.
A feature that I added is you can only scroll the the fence when you are touching the fence. Additionally, a fence won't disappear while you are dragging your finger across it.
When you click a flower, another will spawn on the fence layer below. You can now drag the flowers regardless of where the camera actor is (the mouse pos was getting screwed up when you scrolled). I had to create an integer attribute and do some math to compensate for that. Let me know if you would like me to explain that some more. Here is the demo:
http://dl.dropbox.com/u/16233669/changing layers and dragging demo.gameproj.zip
Let me know if you have any questions about what I did in the demo or for anything else. You can email me as well: jckmcgraw@gmail.com
Regards,
Jack McGraw
Wow that's awesome Jack. Thank you so very much, no way I would have figured this out myself. Thanks for all your trouble!
Maaike