LittleStain's Recent Forum Activity

  • From the manual:

    Mouse expressions

    AbsoluteX

    AbsoluteY

    Return the position of the mouse cursor over the canvas area in the HTML page. This is (0, 0) at the top left of the canvas and goes up to the window size. It is not affected by any scrolling or scaling in the game.

    X

    Y

    Return the position of the mouse cursor in game co-ordinates. This is (0, 0) at the top left of the layout. It changes to reflect scrolling and scaling. However, if an individual layer has been scrolled, scaled or rotated, these expressions do not take that in to account - for that case, use the layer versions below.

    X("layer")

    Y("layer")

    Return the position of the mouse cursor in game co-ordinates, with scrolling, scaling and rotation taken in to account for the given layer. The layer can be identified either by a string of its name or its zero-based index (e.g. Mouse.X(0)).

    so:

    mouse.x(0) - would be the x-position of the mouse on layer 0

    mouse.x("HUD") - would be the x-position of the mouse on layer with the name HUD

  • There are so many ways to make something like this it all depends on what you'd like to do with it..

    Which part of this do you have difficulties with?

    The red block moving from left to right and back can be done with many movement behaviours

    Stopping the movement on space bar shouldn't be hard..

    Comparing the position of the red sprite and determining it's distance from either 1 or 25 to get the right value could be done by comparing the x-position or distance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Like I said..

    If you use Player.8direction.movingangle it should work..

    system is within angle : Player.8direction.movingangle is within 5 of 90 - play animation "down"

  • Seeing the video, you could also just put all the compare variable conditions as subevents of the every x seconds event in which the choose action is performed..

  • first make a global variable called sprite count then go to the action "for each" under the system object which allows you to say "for each "sprite" add 1 to sprite count.

    This will add 1 to the variable for each enemy every tick..

    After 1 second with 10 enemies at 60 fps the variable would be 600

    resetting it to 0 every tick before repeting the for each event would solve that ofcourse,

    but enemy.count will allways stay at the amount of instances of the enemy object present, so using that would be much easier..

  • > You can use int(), floor(), ceil(), round()... with random() to get rid of decimals. For example random(5) can give you 4.42425353.... but int(random(5)) will give you 4.

    > Or you can use choose(1,2,3,4,5,6,7,8) to chose one random value

    >

    I am trying to make a boss that makes it spawn a random enemy when x=1. But now when I do this it spawns a TON of them

    Could you please share the event/conditions you use for the spawn action and explain what is happening now and what you expect/like to happen?

  • So why when i delete it from the game, the total (ESTIMATED) memory usage drops 2.6 mb

    1.92, in theory (theory?) for this image, creates a (ESTIMATED) 2.6 mb drop in the game when it's deleted.

    It could even be the estimated memory usage is too low if the sprite is put on a "power of 2"-size texture, which (sometimes?) happens..

  • I'm not sure what you mean by "Player at 0 degrees"

    Are you comparing : Player.8Direction.MovingAngle ?

  • set the global variable to : NameBox.Text

  • The 705 kb is when it's decompressed. 705 kb is the space that it takes up on the hard drive, even before it has been loaded into the game. The 705 kb on the hard drive is the decompressed version. I see 705 when it's on the hard drive. Then I see the total usage in the project window, i delete the object, and it subtracts 2.5 mb.

    How can it end up being bigger? When the 705 kb is at its decompressed size. If the file size is really 2.5 mb then how can it be taking up 705 kb on the hard drive?

    Is there a way to see how much data usage an object in the Project is using? Like a list, or something, that shows the data usage of an object in the Project.

    I'm not sure you understand the meaning of decompressed..

    if a picture is 1024 pixels by 1024 pixels, in image memory it will be 1024 x 1024 x 4 = 4194304 bytes

    on the harddisk, depending on which format it is saved to and what compression (png,jpg,gif) is used it could be (is) much less..

  • > How can a 705 kb file end up taking 2.5 mb of data usage in the product?

    >

    Like I said..

    When used it is decompressed..

    Image size in memory is based the amount of pixels in the image editor (import size), not on screen..

    Edit: Oops, sorry, thought I pressed edit instead of quote..

  • How can a 705 kb file end up taking 2.5 mb of data usage in the product?

    Like I said..

    When used it is decompressed..

LittleStain's avatar

LittleStain

Member since 26 Apr, 2011

Twitter
LittleStain has 4 followers

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies