How do I find whats the random coordinates that system

0 favourites
  • 5 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • Random coordinates that system creates sprites.

    I just want to know the coordinates where sprites is createn randomly by system.

  • you can try setting up a textbox object and then do every tick - set textbox to sprite.X & "," & sprite.Y

    That would make your texbox to look like 46,46 on the screen if the sprite x position is at 46 and the y position is at 46

    Although you could just as easily go into debugger menu and pause and then click on the object in the left and there is a property you can look at its X,Y.

    Why would you need to know how to find out a newly created object's X/Y position ?

  • you can try setting up a textbox object and then do every tick - set textbox to sprite.X & "," & sprite.Y

    That would make your texbox to look like 46,46 on the screen if the sprite x position is at 46 and the y position is at 46

    Although you could just as easily go into debugger menu and pause and then click on the object in the left and there is a property you can look at its X,Y.

    Why would you need to know how to find out a newly created object's X/Y position ?

    I want to figure it out. I mean, how is C2's brain working like ?

    How is C2 gives random coordinates.

  • Here a good article on it http://www.howtogeek.com/183051/htg-exp ... m-numbers/

    it isnt a C2 issue its a all and every electronic computer module uses it.

    But yes it is confusing just dont ask how it does it. just be glad that you can use the function. And as far as random coor its usually determine by your layout size such as this the min coor are 0,0 and the max coor is what ever your layout size and know this if you dont put a clamp on the number like int or floor or round it just gonna do 1.8888888888888888888888888888888 in a number so in other word in coor you will never get a negative number. its alway postive.

    but as far as how does a computer get random result...just call it magic lol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use random() and then in the event just write the coordinates to an array at X and Y. Then you can access those coordinates by Array.get(1,1) .get(2,2) etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)