randomly's Forum Posts

  • Hey Arashee,

    I googled "Red Ball Game" since I didn't know what movement you are actually pursuing.

    I found this one and I guess this is what you want to do: kizi.com/games/red-ball

    The trick is to not use Custom Movement, but to use the Physics actions such as "Apply Force".

    Here is my capx: dropbox.com/s/5fmehbqavy23p3d/RedBalls.capx

  • 99Instances2Go

    You are amazing, thank you so much!

    I applied your formula(e) to my project and it worked perfectly!

  • johnkx

    Are you wrapping with NW.js or how are you opening the filechooser?

    I think since you aren't directly programming in Apple's native programming language, but in html, you can't prevent that from happening.

    The user has to press gallery, that's one touch more. If you just explain what he has to do, it'll be fine.

  • I tried to, but my solution doesn't work.

    If there were just two enemies, you could implement a short AI function to move the enemies away from each other when they are close.

    I tested my idea with 5 enemies and that didn't work.

    Sorry, I guess, you'll have to go with 's idea and try the Chipmunk physics.

  • Could you provide a link to your capx please?

    I would really appreciate that.

  • Hey Taximan,

    you can do the following:

    • insert the "Browser" object
    • add a condition: Browser: Is online (inverted, right click, invert condition)

    - add an event: System: set timescale to 0

    That's it.

  • Glad I helped you.

    To increase gravity's effect on the Sprite, you would have to increase its Density.

    That would mean though that you would have to tweak the Force applied to the Sprite on key pressing.

    You would have to increase the Force so that the Chopper still gets pulled up at an acceptable speed.

    You just need to find a good balance between Density and Force.

    _____________

    I like your game idea, looking forward to see where your project goes. :)

  • Let's make this a bit easier: instead of using Custom Movement or MoveTo, you can just calculate the position the Sprite needs to go since you know the width of the Layout.

    This just works if I understood you correctly and you want to push the Sprite 600 pixels to the right to make it appear again on the left.

    So, the action you need is the following:

    Sprite: set X to: 600-(LayoutWidth-Sprite.X)[/code:1du7vroh]
    That's it, basically.
    
    What happens here?
    [i]LayoutWidth-Sprite.X[/i] calculates the x distance needed to move the current Sprite.X to the edge of the Layout.
    When that gets substracted from 600, you get the distance from the left edge of the layout (x=0) to the wanted x position.
    
    This works for your layout scale. If your layout is bigger than what is displayed, you can use [i]WindowWidth[/i] instead.
    
    I hope I could help. :)
  • I don't have my C2 available at the moment, but maybe you could try this:

    • check whether the enemy is near another enemy (through the "Is between two values" system condition). Alternatively, go with the "When Overlapping" condition though it might be a bit late when they are already overlapping
    • when that is true, just reduce the speed of one of the two enemies to zero.
    • add another condition, when the two enemies aren't next to each other AND one enemy's speed is zero (which selects that enemy), set its speed back to its original value

    If you encounter any problems or this doesn't work for you, I can setup a little capx for you.

  • Drury33

    I don't think there is a way to compile two different projects to one single one.

    You will probably have to merge the projects by dragging and dropping.

    So since you already did that, let's deal with the Audio error.

    Did you put the Audio files exactly there where they have been before? With the exact same names?

    Are they maybe in the "Files" folder instead of the "Sounds" folder?

    If none of the above is the case, try to search for the audio events in the Event sheet and look whether the names are confused or something.

  • Donkeykong12

    Did it work for you?

    Did I understand you correctly?

  • Yo Donkeykong12

    I created a .capx for you. :)

    Download .capx

    When I started thinking about a way to implement what you want, I figured that it would be the easiest way to go with the Physics behaviour.

    So I went and added a Physics behaviour to the Chopper. (You can modify the chopper's movement in the air with the Physics's parameters like damping or density).

    The way the Chopper gets moved is the following:

    I added two ImagePoints to the Chopper's Sprite (which I created just for you, it's ugly I know), one at the left rotor and one at the right.

    Now when you press the left key, a Physics force is being applied to the left rotor, towards the direction the Chopper is facing at the moment.

    The same is for the right key, just that the right rotor is being affected.

    That is basically it. There is much to tweak for you to fit the Chopper's behaviour in the air to your liking. You can do this via these parameters:

    Chopper's physics behaviour - parameters:

    • Density (affects the general speed of the Chopper, the lower the number the more do the forces affect the Chopper)
    • Linear damping (affects the acceleration and deceleration in the air, the higher the number, the faster does the Choppers speed reduce)
    • Angular damping (affects the rotation speed, the higher the number, the slower does the Chopper turn)

    Event sheet:

    • Apply Physics force X at Image Point (X affects the strength of the force, the higher the value, the faster the Chopper will rotate and the faster its speed will increase)
    • IF Chopper(Physics velocity < -60) THEN Set Physics velocity to ..., -60 (change 60 to whatever you like, this just ensures that the Chopper can't go up at infinite speed, it basically clamps its horizontal up speed to maximum 60.)

    I tweaked the settings so that the Chopper is somewhat controllable, change the settings as you want or implement it in your project if you dig it. You can take my Sprite even if you want. (Though I don't recommend it, it is NOT particularly beautiful. It took 5 minutes to create and that's how it looks like lol)

    That's all to say. I hope, I understood you correctly this time. :D

    Have fun with this capx.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks so much everyone for your responses!

    I took a look at 99Instances2Go 's and 's capxs. I figured, I'd just add the "rotate to" action to my project, because that looks like the easiest and shortest version to me (I'm a lazy person). Thanks for your suggestion!

    This is solved, thanks again!

    (I hope I don't disappoint those who created a capx, I opened them and read through it, I just think that it's less work to just optimize my existing project. Thank you anyways for taking the time to deal with my problem. :) I wish there was a thanks button on this forum...)

  • Hey Donkeykong12

    I think I start to grasp your idea...

    So the left key controls the left rotor of the helicopter and the right key controls the right rotor?

    So the longer you hold the key, the higher the throttle of the rotor?

    And when you press both keys at the same time, the helicopter will just go straight upwards?

    If that's what you're going for, I'll try to setup a little capx to show you how to do it. (If I'm actually able to do it, but it should work).

  • Well that's why I asked.

    Because I'm still learning and the angle doesn't seem to be very smooth when the mouse is moving smoothly.

    If that's the best solution possible, then I'm fine with that. :)

    Well, maybe there is a better solution for the stuff before the angle() stuff...