monitz87's Recent Forum Activity

  • Hi everyone.

    I'm trying to implement a view where the entire layer rotates around the player when I move the mouse (think of it as a top-down first person shooter). I'm running into problems whenever I've rotated too much to one side and the mouse hits the border of the viewport. Whenever that happens, I can't keep rotating to that side because the engine doesn't register the mouse X position to be any greater. Is there some way of removing the boundaries on the cursor or resetting its position when it reaches the border?

    This is how I'm rotating the layer, and it works (even movement works)

    As you see, at some point Mouse.X will reach the end of the layout (or viewport if I use AbsoluteX) and then I simply can't keep rotating in that direction. I'm wondering how other engines handle this sort of camera scheme, since first person shooters let you spin all you want in the same direction.

    Cheers

  • I just figured out that the debugger itself (especially while inspecting the System object) uses a whole lot of CPU. If I run the preview without the debugger (or simply don't select any object to inspect) it runs just fine, and I don't get the inconsistent collision checks D:

  • any insight into this?

    I just read scirra's HTML5 test topic (I can't post the url because of my rep :c)

    And the game they're using to test uses a lot more sprites than I do, and I'm guessing a lot more collision checks per second also, so why does it run so smoothly? My game doesn't even have effects yet

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I recently added a new feature to the game I'm making, and for some reason I'm taking a hit in performance.

    The debugger tells me the game averages between 150 and 200 objects, and collision checks/s go from 100 to 4000.

    CPU utilization ranges from 10 to 40%.

    The worst thing is that for some reason, the engine sometimes doesn't detect collisions between moving objects that were detected before (this is not consistent, I checked with save/load in the debugger, and most of the time detection works). I'm using the moveTo behavior and the fastest moving objects move at 200 pixels/s (their collision polygons are 10x10 in size)

    I won't post a capx for your sake (more than 250 events in the game), but if anyone wants to help and needs more information, I'll gladly provide it.

    Cheers

  • Add Opacity=100 to event 1.

    this

  • Both of the examples you posted as images should be fixed by using the "Else" condition between the "Selected = asdf" conditions. Though I agree with you on the first one, it shouldn't be necessary because triggers are supposed to run only once.

    I'm thinking that because of the nature of triggers, whenever you fulfill the condition of a trigger, it gathers all triggers of the same kind, queues them and checks if they are able to run because of previous conditions in order, so by the time they check the second one, the "Selected" condition is also true for that one, and it runs anyway.

    Else should be your solution

  • Have you tried with System->while?

  • You should be able to do it with Else

    This should definitely work

  • Did you use System->Else on both of the events? (< X and > X)

  • Here's where I put it, is this still correct? The logic seems to make sense to me, but the enemy always plays all four animation frames before switching to enemystate "attack".

    [attachment=0:2um2sjtn][/attachment:2um2sjtn]

    Could you tell me where I could find in the manual (or elsewhere) how to write the expression for checking if any of a number of animations have finished? Basically I want to do something like:

    Enter the name of the animation that has finished: Animation: "enemykick1", "enemypunch1","enemypunch2" (that doesn't work of course)

    I seem to be able to find everything I don't need to know, but never what I do.

    I think I found the problem. You should put the overlapping condition before the other two, and use System -> Else.

    Most of the time, if two sprites are overlapping, their X coordinates aren't necessarily equal, so, for example, let's say that your enemy is already walking right towards the player when you enter the base level event, and enemy_bbox is overlapping player_bbox, but is still a little to the left (enemy_bbox X < player_bbox.X). You first enter the "enemywalkR" subevent, and it waits for 0.1 seconds (I'm guessing that's enough for some frames of the animation that was already playing to play out), it starts playing the animation again and only then enters the stop event.

  • As an action for enemy_bbox is overlapping player_box (and I don't know why there were two of those 'overlapping playerbbox' there, I removed one).

    Strange, it should work there

  • Where did you try using Stop Animation?

monitz87's avatar

monitz87

Member since 27 May, 2014

None one is following monitz87 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies