NetOne's Forum Posts

  • Sometimes I surprise myself. Try this. Just make a Cannon sprite (with an image point 1 at the end of the barrel), a Bullet sprite with bullet behavior and a Badman enemy sprite with drag and drop behaviour. Works perfectly and really cool. bullets allays hit the badman as long as in range. sorry I cant upload anything as Im at work. I just copied the formula off Wikipedia

    | Global number RangeX‎ = 0
    | Global number AltitudeY‎ = 0
    | Global number GravityG‎ = 5000
    | Global number BulletVelocityV‎ = 3000
    | Global number TanAngleA‎ = 0
    | Global number AngleA‎ = 0
    
    + System: Every tick
    -> System: Set RangeX to Badman.X-Cannon.X
    -> System: Set AltitudeY to Cannon.Y-Badman.Y
    -> System: Set TanAngleA to ((BulletVelocityV^2)+((√((BulletVelocityV^4)-(GravityG×((GravityG×(RangeX^2))+(2×AltitudeY×(BulletVelocityV^2))))))))÷(GravityG×RangeX)
    -> System: Set AngleA to atan(TanAngleA)
    
    + System: Every 0.3 seconds
    -> Cannon: Spawn Bullet on layer 0 (image point 1)
    -> Bullet: Set Bullet gravity to GravityG
    -> Bullet: Set Bullet speed to BulletVelocityV
    
    + System: Every tick
    -> Cannon: Set angle to -AngleA degrees
  • Sorry, I just saw you want to perfectly calculate the trajectory to hit the player.

    Yea that's gonna need some math. nooooooooooo..

    Im sure there was a few examples available over the years. is nOthing coming up when you search? (make sure to search the C2 threads as well) . Or there is probably tons of demos on you tube where you could just transfer over the maths into c3 events. I might have a go on the weekend if I have time.

  • Ok. did a little more digging. So.

    1) In trying to make an example project I can confirm that there is always black screen after default loader as layout images are loaded into gfx memory.

    2) However, this black screen time is acceptably small, fraction a second on a fast machine, even if I am loading in 30 large images ranging from 1000x1000 to 3000x3000 in size, looks like it is hitting around 300mb gfx memory.

    3) but my game seems to be loading in over 1.3GB for the layout. which seems a excessive for what Im doing so it looks like I may have some legacy large images in there that have been overlooked.

    So I will have a dig around my project to see what is causing the large gfx load

    but yea definitely looks like there is black screen during gfx load which will be obvious with large games on slow machines so I may raise a bug for that.

  • Ive noticed that as I add more art to my layout I am getting a long black-screen after the default load screen before the game actually starts.

    Dubug indicates that this blackscreen occurs while loading gfx assets.

    Ashley, could we not keep the loader on until all assets loaded ? Otherwise it looks like the game has frozen.

    or am I doing something wrong ???

  • Bullet behavior has gravity, just use that.

  • Hi,Where is object count found? I cant locate that,that sounds like what I need.

    you would find it available inside system condition like "compare two values"

    then the expression would be enemysprite.count" is >= 1 etc.

  • Just to add, you can count objects that exist in a layout using object count. may be better than adding 1 to a variable when they get killed. (note you cant count them if there are none there so you need to do something like if enemy count is >= 1 , else go to next level)

  • if setting the test to enemy killed >=10 worked then that means your logic is not working correctly as you should never have more than 10 enemies killed.

    its hard to tell without seeing code but it probably means that sometimes your enemies are loosing full health exactly the same time as they are at the end of the path so you are getting 2 added to the enemy killed variable.

    test the enemy killed variable and track when it goes >10

  • thanks oosyrag yes that is what I was trying to say :(

    Ashley

    oh, ok , I will file a bug then.

  • Fengist

    "you're going to have to create more intermediate frames for the animation to make it look smooth"

    yea that is the point I am badly trying to make. You cannot currently have more tha 60FPS (animation) when the game is running 1x timescale.

    so if the game is running 1/60x timescale you cannot have more than 1FPS (animation)

  • tunepunk

    If you want smooth animations ....

    yea totally agree im just saying there may be situations where you might want/need to take advantage of a higher than 60 FPS animation.

  • Ashley

    Slowing down the game will make animations run slower, not faster, right? So the cap wouldn't be a problem.

    Yea that is the issue, the animations will run slower so the 60 FPS animation cap then becomes an issue.

    if the game is running at 1/60 timescale then animation will be running at 1 frame per second. and you cant currently make the animation run faster than that (unless you give it its own dt).

    There is no fixed cap, it's just at the moment sprites don't advance more than one animation frame per tick. On a 120Hz display that means you can run animations at 120FPS.

    There is definitely a cap of 60 FPS in the animations editor. (which I am assuming is (game) frame-rate independent but it sound like you are saying it is not?)

  • I've just realised that animations are set in frames per second and locked to maximum 60 FPS in construct 3

    in normal cases I suppose you would have to be a masochist to want to animate above 60FPS in 2D

    however if you had a game with an extreme slowdown feature you might want more than 60FPS on some key aspects to avoid choppy animation in the slow-mo phases.

    and, as discussed elsewhere, as higher than 60FPS frame-rate hardware is becoming more common some users may want above 60 FPS animations for ultra smooth animations. (especially as you can get something like Spriter to chuck out the frames for you.(assuming it will output more than 60FPS)

    so may be worth increasing the FPS cap on animations.

    Ashley just throwing it out there

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I always just paste under the relevant event then drag it to sub event (i think that is what you are saying you do as well.)

    never thought its that much hassle but are you saying there is a way to paste directly as sub event ??

    ive just tried now and still cant see how?

  • So it dosent matter how many family members there are? You can have 1000 members of each family and when you do a family to family check, if there are no instances of a family member in the layout that family member wont be included in the check?