dop2000's Recent Forum Activity

  • Start small - with checking the speed and angle only. Maybe it will be enough for your purpose.

  • Stylesheet? Did you mean event sheet?

    You can use "System Compare two values" condition for Touch.SpeedAt()

    and "System Is Between Angles" or "System Is Within Angle" to compare Touch.AngleAt()

    Note though, that if you want to detect swipe gestures properly, these are not enough. You also need to check that the finger is not changing direction, compare time etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • pirx Using "On Created" is a clever idea, as it's triggered immediately. Anyway, at the moment I am quite happy with the current system. If in the future (very distant I hope), old functions stop working, I'm sure I'll find some replacement.

  • Ashley, and what will trigger those layout-specific functions?

    There is about a dozen different ways players can interact with items in the game. Besides, every scene is heavily scripted. All of this is currently handled by the MAIN event sheet (200+ events). I can't move this code to layout event sheets, this will not make any sense.

    .

    Anyway, I didn't mean to hijack this thread, sorry :)

    I am not trying to say that the old functions are better, only that in some cases they are more convenient.

  • Another approach would be to have unique functions on every layout

    This is not possible in my project. Like I said, all core mechanics is in the MAIN event sheet - it performs a bunch of different checks, gestures recognition, modifies instance variables, enables/disables behaviors etc. And only then it calls a custom function from layout event sheet for some finishing touches.

    The only way for me to use new functions here is to call them by string name from a script, as chadorireborn suggested. And I will still end up with a thousand function names in the list..

  • If you want the camera to follow the player smoothly, the most common way to do this is with lerp:

    Camera set x to lerp(self.x, player.x, dt)

    If you want to move the camera only when needed (for example, when player walks into another room), the easiest solution would be using MoveTo behavior.

  • C3 has Drawing Canvas object. Unfortunately, there are no other alternatives.

  • You start animations in some other events, you can run your code there, or call a function. For frame changes use "On frame changed" event, it's triggered only once for every frame per each object instance.

    I also use this little trick, where I define an image point on one frame in a long animation, to mark it as a "key" frame:

  • That makes sense, although what could I use as an alternative? If I wanted to run something only once when the animation starts, or only once when a frame starts what would I use instead of trigger once?

    You start animations in some events, use the same events to run your code, or call a function from there. For frames - you can use "On frame changed" event, it's triggered only once for each frame.

  • I would suggest using function maps instead.

    Ashley I know about function maps, but they are not very well suited for large projects like this. At the moment I have about 7 "shared" functions in 10 different layouts. This number will likely grow to 10-15 functions and there may be 50-100-150 layouts in the game. With new functions, imagine the list I will have to scroll through in the Call Function dialog, or in the dropdown box for Map Function dialog! And I will need 1000+ actions just to create this huge map.

    Old Functions are closer to triggered events, and there is nothing wrong in having the same event like "On Item clicked" in multiple event sheets. So it seems fine to me to have the same function "Item_Click" in multiple sheets. If this was a design mistake, it was a fortunate one.

  • Think of it as the same one function spread over multiple event sheets.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 280 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies