SoldjahBoy's Forum Posts

  • That's a pretty cool idea for a game, nicely made so far as well

    I think my example should do the trick for you. I was playing with mouse though, not sure if the player is supposed to appear so far away from the mouse cursor position or not - but I found it a little disorienting to control because of the offset to the cursor. The powerup collection and the effects are nice though. It has a nice feel even when using the mouse. I had to shew my browser into a funny shape though to get everything in screen - I didn't check what scaling method you're using but it's definitely not computer friendly lol.

    The example I made will work for moving the player in any way (mouse, 8 direction, physics, etc) yet still keeping within the defined bounds (the minimum you can use is like 1, or maybe something as long as it's greater than 0).

    ~Sol

  • OK sounds great

    It might not be the BEST solution, but it might work around the problem for now at least (if it works)!

    ~Sol

  • You should be able to apply a force on any physics object in the direction of the mouse cursor or touch location.

    [Click mouse]

    --- Player.Physics apply force 1000 towards Mouse.X Mouse.Y

    Then you can have gravity naturally applied with the physics behaviour, as well as collision with other surfaces/objects.

    *EDIT*

    EXAMPLE

    ~Sol

  • Yes I forgot about the timer behaviour... I never use it, and I probably should start actually using it, lol. Much easier than doing manual timers for a lot of stuff.

    Great work

    ~Sol

  • You have plugins installed that I don't use

    Can you remove the plugin or does it affect what your issue is? It usually best to provide a plugin-free capx for troubleshooting or a minimal recreation of the issue if removing plugins isn't really possible.

    ~Sol

  • You need to save it as a single file, not as a project folder. Then you can link in dropbox like you did before, but to the file only

    Like this EXAMPLE capx that I made which bounds the player to a definable area on the viewport. You can adjust the bounds as you wish - and can even set them to an expression if you want (like [player.width/2] for example).

    ~Sol

  • Your link leads me to the project folder - but there is no capx file there (only a backup).

    I'm going to suggest though without looking at it, that you can bound the player to viewport (at any size or shape) by using the method I mentioned above. I have done this for my camera object on a layout that is unbounded scrolling.

    [If player.X is less than viewportleft("layer") + (player.width/2)]

    --- Player.X set X to viewportleft("layer") + (player.width/2)

    Do this for each side of the viewport (top, bottom, right) and your character player won't be able to leave the view, but enemies are free to move around the entire layout still.

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The fps looks respectable on devices less than 3-4 years old... that's not bad really.

    Still you don't mention about the resolution you are using for sprites and things like that. A handful HD graphics will perform a lot worse than thousnads of lo-fi "simple" graphics.

    ~Sol

  • I'll take a look... so you want to bound the player to the viewport, but not the enemy? Is that correct?

    ~Sol

  • Bound your enemies or objects with events instead of using solid objects to bounce from.

    If they exit the viewport by 1 pixel then have them change direction by something like (self.angle-random(170,190))

    Is this what you want to happen?

    ~Sol

  • Getting a 404 error when trying to download your capx

    ~Sol

  • I think you may be hitting hardware limits here. Most keyboards are only designed to accept the buttons being pressed simultaneously under a certain limit.

    A cheap keyboard may only allow 3 at once, where a gaming keyboard may allow 8 or 10... if you have multiple people using the same keyboard (local multiplayer) then that could be affecting your problem here.

    ~Sol

  • Yeah maybe test for overlap at offset with the wall tile - so you might need to check in a radius or each direction in a square.

    If offset is compared at say X + 1 (or even X+2) then move light to self.X-1

    Do this for each direction or use some trigonometry to calculate the radius

    That should work, I think!

    ~Sol

  • What device are you testing this on? It doesn't look like it should be causing ANY problem for fps, at least as far as I can tell from the events you've shown.

    What size are the sprites you're using? Is this all lo-fi graphics or more HD style?

    ~Sol

  • With a state machine you can jump to any portion of the sate machine you want.

    Using my dirty-example above all you need to do is have a couple of extra conditions on the state change like;

    [On Touch]

    [Room1State=0]

    --- Activate room

    [On Touch]

    [Room1State=1]

    [Touch is on power-up object]

    --- Collect Power-up

    --- Set Room1State to 0

    [ELSE]

    --- Set Room1State to 0

    I guess my pseudo code isn't exactly accurate to your specific circumstance, but it would be the method that I would use if I were trying to achieve what you're trying to build.

    Basically by having a state machine - and comparing the touch position (is it within X distance to the powerup) you can control which "thing" the player is actually touching on. You may also find this can be solved by making the bounding collision box of your power-ups larger - because from memory, it shouldn't "click through" anyway - but it's been a million years since I've made anything for a touch device (so I wouldn't go by my terrible memory of things).

    Think of the state/gate system as a fail-safe. If the power-up exists in a room then the state is 1... but if the player presses on the room and the power-up coordinates are far away from the touch position, then set state to 0 and the player is activating the room itself, otherwise it stays as 1 and collects the power-up then goes to 0.

    I hope this makes it a little clearer.

    ~Sol