My apps about 50% done! But i have a few questions. (please help)

DanielAvniDanielAvni Member Posts: 114
edited November -1 in Working with GS (Mac)
My apps about half way done! but i have a few questions.

1st question is that im making it so when the ball collides with the enemy it gets destroyed and plays an animation. But it always plays it like .001 seconds haha i cant even see what happens i tried making it so after like 2 secs of the collision the actor is destroyed but that didn't work ether..

2nd Question is how do i make it so the timer randomly spawns the actor between 1,4 seconds.
(i tried random(1,4))

Last and most important questions is that i have it when that theres a ball that i pull back and it shoots. But i want it so that when i touch/press on the cannon it spawns the cannonball and it drags back with ur finger. And once i release it plays an animation. I was thinking maybe making the ball invisible until pressed or something i dunno what do you guys think?
Thanks DanielA!

Comments

  • DanielAvniDanielAvni Member Posts: 114
    Can anyone help me with these questions please
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    It sounds like what you are doing should work. Putting the destroy in a timer should work. If it is not you could try this. Create a boolean attribute called destroy. In the timer have a rule that uses change attribute instead of destroy. Change self.destroy to true. Then have a rule that says when self.destroy = 1 , destroy actor.

    Random spawning should work the way you have it. not sure on that one.

    I think that using the pull back method on the cannon makes a lot of sense. Just put a change attribute behavior in the "when touch is pressed" rule that changes alpha to 1 so that it becomes visible (have it set to 0 initially).
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    have you upgraded to 0.8.3?
  • DanielAvniDanielAvni Member Posts: 114
    dude u are the best thanks so much and yes i did upgrade. why?
  • quantumsheepquantumsheep Member Posts: 8,188
    scitunes, you are a saint amongst men :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @ danielA - I only ask because I thought I read that internal rules have been improved. So i mentioned it in case that was the issue.

    @ QS - I knew absolutely nada when I started about 9 months ago and I am no expert now, but because of people like you on this forum I have been able to make games that I can be proud of. So I am just paying it forward.
  • quantumsheepquantumsheep Member Posts: 8,188
    Group hug?

    :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • DanielAvniDanielAvni Member Posts: 114
    haha
  • DanielAvniDanielAvni Member Posts: 114
    I thought i had a perfect idea but i guess not. this is what i was thinking i made the ball invisble untill i press it and i made a boolean (called Cannon is alive) so when the cannon hits the walls it changes it to false and in my spawner after i made a rule that says if cannon is alive is false then spawn him and change attribute to true what did i do wrong?
  • DanielAvniDanielAvni Member Posts: 114
    any read this have any ideas?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I'm having a hard time understanding what you did. Can you spread it out a bit. like:

    In canon:

    RULE

    when touch is pressed
    -change attribute game.cannoinisalive to true

    etc.
  • DanielAvniDanielAvni Member Posts: 114
    kk umm well what im trying to do is make it so that i can shoot the cannon ball as many times as i want.
    What i was thinking is.
    I made a game attribute (boolean) called Cannon Ball Alive
    Cannon Ball:
    Rule actor receives event: overlaps or collides with wall (wall is outside of the map)\
    Change Attribut:Cannon Ball Alive to False
    Destroy this actor

    Spawner:
    Rule:attribute:Cannon Ball is Alive is false
    spawn:cannonBall
    Change Attribute:Cannon Ball is Alive to True.

    Thats w what i did so that when the cannon ball hits the wall a new one spawns...
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Spawning and destroying can effect the memory and FPS. So here is something to try. Just have a rule in the canon ball that says

    Rule
    When actor collides with wall
    Change attribute self.positionX to X start position
    Change attribute self.positionY to Y start posiition
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    This way it will look like a new one was spawned but really you are just "recycling" hte same abll
  • DanielAvniDanielAvni Member Posts: 114
    ok but theres only one problem with that when it goes to its old position it keeps falling (im using the same code and everything as the arrow demo you made) and i tried change velocity to 0
  • scitunesscitunes Member, Sous Chef Posts: 4,047
Sign In or Register to comment.