Super Advanced Question...

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
Here's what I want to do;

I'd like to have a player-actor throw a grenade. However, I want the magnitude between the player and the area in which the player throws the grenade to have a factor (meaning the closer to the actor the better chance of hitting in the middle (call it a bullseye) and the farther the distance of the throw the lower the chance of hitting in the bullseye).

So. As is stands now, I have a player-actor that's in the middle of the scene (he has camera control) and when the player selects the grenade-mode a "target" (an image that I created) appears. The player can move this target by touching and dragging it to where he wants to throw the grenade.

I want to make it so that as the player drags the target farther from the player-actor the target "area" increases making it more difficult to 'hit the bullseye'.

SO, FINALLY TO MY QUESTIONS;
1. How do I change the size of the "target" to reflect the distance (grow larger as the distance increases).
AND
2. How do I make GS understand that I want the grenade to throw to a random point within the "target" actor? Is that even possible?

Thank you, this seems like an insane question. However, I do hope that this is an easy fix. Thanks!!

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    If it helps, the is a TOP-DOWN action game. Not a side-scroller.
  • DrGlickertDrGlickert Member Posts: 1,135
    Good news, I answered question 1 by myself.

    Does anyone have an answer for question 2???

    Thank you.
  • anithmukanithmuk Member Posts: 235
    for question 2 you could say something like:
    change grenade position x/y to target actor position x + random(-50,50)/ position y+random(-50,50)

    Not sure what that would do in practice, but in theory I think it should place the grenade at any random spot within a 50x50 square with the target in the centre of the square.
  • DrGlickertDrGlickert Member Posts: 1,135
    Okay, I think I'm really super close to answering this one on my own...

    It's going to require a super long answer. So if anyone else wants to hear it I'll post it, but if not then I'll let it go.
Sign In or Register to comment.