TRMG's Recent Forum Activity

  • Hi everyone! I'm currently making a level editor for my game. For the PC version I'm using NW.JS to save and load a text file, but NW.JS doesn't seem to work on Android (at least not with the same code as for PC).

    I don't want to use local storage for Android because I want the player to be able to copy the file to their PC (So they can play the levels they made on Android on a PC and vice versa)

    Do you guys have any idea as to how I could do this?

    Thanks in advance!

  • Hi Isaske,I'm also searching how to save a .txt file on android and can't find any solution.

    Did you figure out how to do it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does your bullet fly straight? You can run a raycast.

    Events: https://www.scirra.com/tutorials/902/li ... raycasting

    Plugin: plugin-jcw-trace-raycast_t172320

    If you are using physics, parabola-tracjectory-tracing-with-physics-box2d_t77802?start=10 might be of help.

    Awesome! Thank you very much!

  • Hi everyone!

    In my game I need to know if an enemy tank can hit the player if they were to fire at a specific angle.

    I've done it so far by using a clone of the normal bullet (the purple bullet in the pictures), setting it's speed really high and checking if it collided with the player.

    My problem is that because the game is turn based and these bullets take a few 1/10 second to finish, the game feels sluggish to play.

    I thought of using sprites that would curve along the path of the bullet to test collisions, but these sprites would need to be really long and since the enemies can move on walls and ceilings (making the trajectory of the bullet slightly different) I would need a lot of them, so it's not really an option...

    So, do you guys know of a way to check if the bullet would hit something that is fast enough so that it doesn't feel sluggish?

    Thanks!

    Also, if you're interested in the game, you can download the wip version here: https://www.dropbox.com/s/82j3k66qfopqh ... 1.zip?dl=0

    Let me know what you think!

  • dop2000 Thank you very much! Looks like the "Every X seconds" event was the problem.

    I guess the events in the loop would terminate when it would move on to the next index, thus not triggering anymore the "every x seconds" event.

  • Hey guys, I'm trying to set an instance variable called "FallSeconds" on each instance of an object based on it's velocity at it's angle.

    Img:

    I am using this formula to calculate the velocity at an angle: cos(ANGLE)*OBJECT.physics.velocityX + sin(ANGLE)*OBJECT.physics.velocityY (Thanks to R0J0hound for the formula)

    Then if it's >50, every 0.1 sec I add 0.1 to the "FallSeconds" var of that specific object

    If it's <50 I set it once to 0.

    (I need the FallSeconds var to check if the object fell too much and destroy it)

    My problem is that instead of checking for each object's velocity and adding only to that object's variable, it picks only one object to check the velocity and sets all other object's variable according to that velocity. (i checked this with the "cursor is over object" event)

    I have tried adding a "Pick all OBJECT" event, as well as leaving it empty, but it had no effect, and when I added a "For Each OBJECT" event, it would only work on 1 object and the others would not change...

    So, do you guys know what I'm doing wrong?

  • dop2000 Hey, that method worked great.

    Thanks for your help.

  • dop2000

    That wouldn't work either in a situation like this:

    The egg could also hit the ground object from the right or left.

    I also can't hard-code an angle to check against for each ground object because the egg could hit the ground from multiple angles...

    I saw another forum post where someone else found a way to do this by attaching some small sprites around the object and checking if they overlap with another object. If they did, then I could use their position for a rough estimate for where the collision took place.

    I'll try this method and see if it works in my case too.

  • [...]why can't you compare egg's velocity at the moment of collision?[...]

    You mean the overall velocity?

    Well if the egg were to move really fast towards the right and only slightly downward and it would hit the ground (that is underneath the egg), it would still break.

    I want it to break only if it's velocity at the angle of the collision is too high.

  • Hey there, I've got an egg (with physics) in my game and I want it to crack when it hits the floor to fast.

    Img:

    I can use this formula to calculate the velocity at a certain angle: cos(ANGLE)*Egg.physics.velocityX + sin(ANGLE)*Egg.physics.velocityY

    but I don't know how to get the collision point so that I can convert it into an angle and then compare it...

    Do you guys know how to do this?

    Thanks!

  • [...]iOS also is not very friendly towards new games that don't have a lot of demand.[...]

    Is that so?

    I was thinking of buying a licence for the Apple store; do you think it's worth it for releasing smaller games?

  • totoe Oh sorry, I tried the dropbox link before the google drive one and since it didn't work I thought the google one wouldn't either...

TRMG's avatar

TRMG

Member since 4 Dec, 2015

None one is following TRMG yet!

Connect with TRMG

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies