ome6a1717's Recent Forum Activity

  • Actually I just tested it again, and you are right. That seems a little silly...

  • I have a menu that uses up & down arrows to change the animation frame. My current line of code is:

    On Down Arrow >

    Set animation frame to "(Sprite.AnimationFrame+1) %Sprite.AnimationFrameCount

    This works perfectly, but with my up arrow event (same event as down, only -1), when the animation is at frame 0, how do I make it loop back to the last frame?

    I've tried a sub-event of "If Sprite.Animation frame = 0", but then it actually SKIPS 0 and goes straight to the final frame.

    Any help would be greatly appreciated.

    Thanks,

    Steve

  • If you use the Browser > Close action, it should work.

    *edit*

    Just saw Joannesalfa's post about this - I have it on my game and it seems to work okay.

  • Well the reasoning for my question was based on scripting - it would be a lot easier to just create new sprites for each enemy and give them their own unique code instead of trying to control them all differently on the screen.

  • Perfect - thanks!

  • So for pure game speed, it's best to use 10 instances of 1 sprite instead of 10 sprites?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have a sprite, and copy the same instance 10 times on a map, would it take as much processing power if you had 10 DIFFERENT sprites on a map, or would it just reflect the download size?

  • Miraculously I figured out a way to do this. This is the event setup I have:

    <img src="http://stevemazzaro.com/Patrol1.png" border="0" />

    With the Patrol function being:

    <img src="http://stevemazzaro.com/Patrolfunction.png" border="0" />

    This works relatively well, but for some reason after they chase me a bit, if I am out of the red box, they will stop, but after running in and out of the box, eventually they stop patrolling altogether. I can't figure out what it is I do that stops them from Patrolling, but the second I'm on the red box, they're back to chasing me.

    Can anyone see what's wrong with this setup?

    Also another small issue, occasionally they seem to stutter a bit on the patrol function, but not always.

  • That's what I had before trying some suggestions here, and it works great for 1 npc, but I found when I had multiple instances of BOTH the enemy sprite AND the invisible sprite, I couldn't figure out a way to link their actions appropriately. I used the For Each command everywhere, but it only seemed to work half the time depending on the action.

    Mr E Bear - If you wouldn't mind, could you upload your capx for me to look at?

    Thanks,

    Steve

  • Id love to hear any other suggestions. Im basically trying to implement zeldas npc behavior. Basically the npc will roam when not having spotted an enemy and has a pseudo field of vision based on the direction facing. So you're able to sneak oassed enemies.

  • Ah - that makes sense. I believe I have changed it so the sprite itself does not rotate when moving.

    With this is mind, can I still use the angle method, and if so - how?

    Thanks so much!

  • As I'm learning through C2, I thought of 2 features I'd personally like to see and wanted to see what the rest of the Scirra community thought.

    1. After creating an event, sub-event, etc., having the ability to double-click and change JUST the object while keeping the event parameters the same without having to go back to the Object list.

    2. Being able to grab a variable from one event sheet into another event sheet.

ome6a1717's avatar

ome6a1717

Member since 12 Feb, 2013

Twitter
ome6a1717 has 3 followers

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies