Simple test failing has got me stumped...

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited November -1 in Working with GS (Mac)
I'm running through some straightforward tests in the Actor editor; just experimenting really. For this particular test, what I've done in the Rules section seems watertight to me, but doesn't work. I'm at a loss to know why.

I'd want the width of the actor to shrink by 2 pixels each time (how many ticks is the default, I don't know) until it reaches a certain width, then stops. (By the way, I've tried out the timer with it, but that doesn't want to know either). So I've done this:

Photobucket

Can anyone help please?

PS 10 to 1 am here in Kent, UK; torrential rain, lightning and thunder. Exciting stuff!

PPS Actually, just thought: is it because even though the width is getting thinner, GS still knows it at it's original width; so I'd have to update a variable in a new attribute?

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Sorry to bother you; i'll experiment a bit more with a variable as an attribute, see how I go. i would have deleted this thread, but doesn't seem to be any way for me to do that...

    Edit: ah phooey, that doesn't work either.

    Photobucket

    Time I was asleep anyhow.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    You could use interpolate, but for some reason collision does not work while interpolating.

    A work-around could be:

    Timer-For 1 second
    -Timer every .05 seconds
    --Change attribute self.size.width to self.size.width+5
    --Change attribute self.size.height to self.size.height+5

    This will cause the actor to grow. In this case, based on the time and addition, it will take 1 second to grow by 100 pixels (.05 x 20 = 1 sec, so adding 5 pixels x 20 = 100 pixels).

    You can play with all of the numbers here to make it faster/bigger/smoother. To shrink it, do the same thing only subtract from the width and height.

    I would not suggest using this for an iPhone game on more than a couple actors considering timers can be very resource heavy. The iPad seems to work fine with this! Let me know if this is even remotely close you what you are looking for!

    -Kyle

    ***Edit***
    Just noticed you were talking about subtracting, so use subtraction instead of addition!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Kyle, that's certainly works, thanks. I did try this though and I found that both shrinking and enlarging work on their own, but I couldn't get them to work together; nothing happens when they are. What I'm trying to work out is a way for an actor to enlarge/reduce on a loop; a forum member posed the problem here:

    http://gamesalad.com/forums/topic.php?id=7256

    My attempt worked as did another member's contribution but both suffered from similar problems: the actor shrinks fine, but enlargement is slow and jerky, nowhere smooth enough. Hence trying to crack the prob another way.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    Uploaded a demo, try this out!

    http://gamesalad.com/game/play/61878

    See if this is what your looking for. I'm sure it could be tweaked a bit but it works! Enjoy!

    -Kyle
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Spot on Kyle, just what's needed! Excellent, thank you for that!

    Though the only problem I have is, like all games posted to the GS site that I see, if I click on Download Project, it opens the app in a web page, rather than downloading the project to my desktop. Hmm, intrigued to know how you did that, but don't know how to get the project file to find out.... :-(

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    hmmm what browser are you using? Maybe try to right click and download?

    If all else fails, just email me at kbegemandev (at) gmail dot com and ill email you the project file!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I'm using Safari, I think that's OK. I haven't a two button mouse, so I tried Control-click; this brings up a menu, with one item being Download Item. I now remember I did that a few times before, and - here's the strange thing - I get the same app downloaded (Chess), whichever download button I try!

    So I'll take up your offer of the project file via email, thanks Kyle.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SingleSparqSingleSparq Member Posts: 1,339
    On a mac just option click on any link to a file to start the download process
    -remember to change the file suffix to .zip so you can get to the file.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi SingleSparq; thanks, but I tried that and all I get every time is still this flippin' Chess program. Very odd; especially if this doesn't happen to other people...

    Edit: I wonder if it's got something to do with the GameSalad Web Plugin that I downloaded and installed? Can't remember where or find it on the GS website again though, but I do remember it was in beta, so could be having a few bug probs... if I knew where it lived on my computer, I'd delete it to see if that solved the prob...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    Mail sent!

    Also, just so you know, when you download any project from GS, it will be a .game file. If you double click this, it is chess and will crash. What you have to do every time is just click the file once, then again a second later. It should now be waiting for you to change the name. Move your cursor over the .game, erase it and type .zip and hit enter. A notice will pop up, and you want to click the "Use .zip" button. This will then change the file into a .zip file, so double click that, it will auto unzip and you will then have a project file! It will have a name like "Upload07.gameproj" and you can change the name to anything you want like "Grow/Shrink Lopp Demo.gameproj".
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Blinkin' excellent Kyle, thank you very much!

    ;-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.