tommyoliversays's Recent Forum Activity

  • C3 should already be preventing this. It might be selecting on the parent page though (the Newgrounds page), in which case Newgrounds would need to prevent it.

    Weird. It also happens on GameJolt and itch, so whatever needs to be done isn't limited to just Newgrounds.

    Kinda strange :S

  • I made an endless runner style game, but on iPad tapping and holding to jump selects the entire game window, breaking the game.

    Is there some way to prevent this from happening, either within C3 itself, or with some HTML in the index file?

  • So a few days ago I published a simple 5-day game, Ninja Suffering, to the web. It should theoretically play on any platform, being keyboard and touch friendly. It works fine on Android and desktop, but on mobile Safari, it has some issues that I wasn't able to catch initially since I'm not a big iOS user.

    Apparently on iPad long presses tend to select the entire game window, which eventually causes taps to no longer work at all. On iPad, there is no sound at all, which I thought might be due to C3 compressing sound files to WebM, but on iPhones sound effects work, just not music.

    Also on iPhones, certain spritefonts don't disappear when they should (If you play the game, the "Speed Up" text in the bottom right doesn't disappear like it does on other platforms.)

    Are these things that I can address, or are they results of limitations of mobile Safari. I know Apple has their own way of doing things, so perhaps there's nothing I can really do on my end. But I figured I'd float the idea just in case.

    Tagged:

  • I was considering using the sine behavior, but I had the idea of syncing platform movements up with the game's music, so tweens give more control over the movement.

    Horziontal movement is fine, but vertical movment causes my character to enter the air state, and screws up the animations and stuff. Oddly, the same platform with sine movement works fine, so I'd assume that rules out my state machine as the culprit, unless there's something under the hood that treats the movement differently?

    I was just wondering if this was a common issue, and if there was a general way to resolve this. Moving platforms are a pretty common feature in 2D sidescrollers, after all.

  • Honestly, I'm not really sure what my issue is here. I've been trying to compartmentalize my game's damage and hit calculation in functions, since I initially built them before the new functions debuted, but I'm having lots of issues.

    Right now, if you kill a second enemy before another one dies, it breaks the entire hit collision of the game. Killing single enemies works, killing multiple enemies at the same time works, its just killing one then immediately another that not only messes up that enemy, but breaks hit detection for every other enemy in the game as well.

    Here's a link to the file. I'm new to using C3's new functions and calling via UIDs, so I'm sure I'm missing something obvious. But I've rebuilt the system four times now with no luck.

    dropbox.com/s/czh4fypus82fz0n/azumi_fullgame4.c3p

    Thanks

    Tagged:

  • You do not have permission to view this post

  • The UID option worked perfectly! Thank you!!!

    Awesome! Glad it worked!

  • Thanks for the in depth reply!

    The reason I only have the functions set up for Enemies is because the player reacts differently to hits. The player takes knockback and has a window of invulnerability, and on death, it triggers a custom series of animations to be more dramatic, for lack of a better word.

    I suppose all that functionality could be broken off into their own functions and called on top of the base damage stuff, but that seems more complicated than what's there now, but maybe I'm overthinking it. I'd be interested to hear your take on the matter!

    The issue I was having with the implementation right now is that, certain enemies would get stuck in either the death function or hit function, and never play the respective animation. They'd lock up and break the entire game, since the function never exits.

    Did you run into that at all? 🤔

  • Please share a sample c3p that we can work with together.

    I've rebuilt it a few times, but this is the latest attempt before letting it go and moving on to other things, if you can figure out what's wrong I'd be very appreciative.

    dropbox.com/s/qwjyve6prhkgsr2/azumi_fullgame3.c3p

  • I'd use the object's UID. Each instance of the door has it's own unique ID number. You can call that specific instance using the UID, then apply the door open logic to that instance.

  • While functions only support 3 primitive values (boolean, number and string) you can use a number parameter to pass the unique ID for an object instance.

    The event sheets use a selection/filtering technique for referring to an object. By default referring to "PlayerSprite" will affects all instances of "PlayerSprite", but some conditions can filter the selection down to some or one "PlayerSprite" instance. Conditions like collision triggers will only select the instance that collided for example. There's also some conditions that allow you to explicitly filter which ones you want, such as "compare instance variable" which allows you to choose instances with a certain value in an instance variable. One of the most useful it "Pick by UID" which allows you to filter to a single instance of an object, that matches a unique ID value. You can use this in combination with a function by adding a parameter for the UID ( which is a number ) then adding the "pick by UID" condition to the function itself. Like so:

    Yeah, I dunno what I'm doing wrong, but for the last 24 hours I've tried non-stop to implement UIDs like you've shown here in multiple different functions and setups, an each time it has completely broken my game. From breaking projectiles, to having attacks randomly start hitting every enemy on screen after working normally for awhile, to freezing the game entirely. This seems incredibly delicate for some reason. No clue what I'm doing wrong.

  • Piece of advice: Pass the object in concern's UID through the function as a parameter.

    This will allow you to always pick the correct object, no matter the family, conditions, etc.

    Example:

    Family "hittables"

    Members:

    Player Sprite

    Enemy Sprite

    Event:

    On bullet collides with "hittables" -->

    Call function "bullet hits something"

    Pass parameters: bullet.damage, hittables.uid

    On function "bullet hits something" -->

    Condition:

    Pick "hittables" by UID function parameter (1) (or function "bullet hits something" parameter hittables.uid") -->

    Substract parameter bullet.damage from hittables.health

    Destroy bullet

    I know this is an old post, but I got wrapped up in other things in the game and am just getting back to tackling this issue.

    I'll be honest, I have absolutely no clue how to call and object by UID like you're suggesting here. I understand what you're saying in terms of actual logic, but in terms of getting it to work in C3 I don't know what events would be used. Been banging my head against it for an hour now looking through the documentation with no luck.

    Could you post a quick screenshot using the events you're referring to just to give me a jumping off point?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
tommyoliversays's avatar

tommyoliversays

Member since 12 Sep, 2018

Twitter
tommyoliversays has 1 followers

Trophy Case

  • 6-Year Club
  • Email Verified

Progress

7/44
How to earn trophies