jobel's Recent Forum Activity

  • I also want to stretch a sprite and it seems the Stretch Fx doesn't have any parameters??

    what did you end up going with?

  • I would do it something like this.

    If distance(prototypeX, prototypeY, player.x, player.y) <= turret.range

    ahh using the 'distance' function.. I haven't used that before, cool thanks..

    but about your: "If, else if, else"

    I wasn't aware you could do "else ifs" and then another nested "else" from the same event.. I actually tried, but maybe I am doing something wrong? I thought it was a limitation of C2...

  • If not redo the placement calculations on the prototype variables until you have acceptable values.

    thanks for the reply..

    so you are saying to create a loop and keep checking until you have acceptable parameters?

    but what about the calculation?

    player.x + turret.range + random(layout.width)

    player.y + turret.range + random(layout.height)

    say my layout is 800x800

    and range is 300

    and the player is at 700,750

    the generated values would have to be approx between 0-400,0-450

    if the player is at pos 20,100 then of course the regular calculation would work...

    I probably have to do a bunch of checking I guess...like:

    if player x is > (layout.width - range) then subtract range instead of adding range etc...

    just wondering if there's an easier way to do it.

  • You can then set their Y coordinates to whatever you want (random, or on the floor/ceiling, etc...).

    thanks for the reply

    the only problem with this is my player rotates, so both player coordinates have to be modified.

  • yes, the range is static. (200 let's say)

    but my layout is 800x800 and if the Target happens to be at pos 780,780 then I can't say Create Object (Turret, Target.x+300, Target.y+300) because it will spawn off screen.

    I need it to calculate going back to zero after the position goes past the layout.x and layout.y

  • still working on this.. thanks for the info! you should make a tutorial!

  • hi,

    anyone have a good idea how to randomly spawn a sprite with turret behavior..but make sure when it spawns it's not in range of the target?

    since the target is moving I assume you need to do some sort of calculation based on target.x and target.y

    I also have wrap behavior for both turret sprite and the target which both move...

  • honestly, it's no big deal.. I only brought it up as I thought was kind of funny and just wondered if it happened to other people. Like a previous person said I've gotten used to it and after I write a post I always select-all and copy it, refresh my browser and paste - it skips a step of being denied..

    I'm sure you have bigger fish to fry...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'd show you the screenshot if I could figure out how to post an image to the forum...

  • i got this...

    X Error

    Only members with sufficient permission can access this page.

    A security error has occurred with with authentication.

  • well, let me write this response and see..

    if I get up and go in the other room....then come back.... it should expire..

    let's see...hitting 'post reply' now..

    yup, still happening..

    great work, can't wait to see it.. I'm a fan!

jobel's avatar

jobel

Member since 27 Jul, 2013

Twitter
jobel has 8 followers

Connect with jobel

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies