Sollaano's Forum Posts

  • Try to use wait system-function at the end of "for each x".

  • I changed the origin point of the sprite to top-left and it worked. I also set it to create the object instead of spawning it.

  • Hi!

    I'm trying to make level editor where you can place blocks in 150 x 150 px grid. I tried to do event like this:

    On click -> Spawn "block" at int(Mouse.X/150)*150
    [/code:1nny5x8x]
    and
    [code:1nny5x8x]On click -> Spawn "block" at ceil(Mouse.X/150)*150[/code:1nny5x8x]
    
    It kinda worked occasionally but most of the time blocks just spawned in wrong places.
    
    [b]Edit:[/b] You probably wan't to see pic
    
    [img="http://i.imgur.com/NNfT1oC.png"]
  • Kcpunk666 Thanks! I solved the problem by setting it not to create underground stone (since I don't really need it)

  • Hi!

    When I generate new random map, sometimes the result will be something like this:

    And that is not fun. You know what will happen when people walk over the gaps.

    I tried to fix this problem by setting instance variable "col".

    If block is colliding with block -> col = 1

    If col = 0 & Pick nearest to "self.y, self.x" -> Create object "block" on block.x + 75, block.x

    It kinda worked but blocks spawn inside each other. Could you tell me how I could spawn block between instances that have var col as 0?

  • I made one example using variable. It's pretty dirty but it works. If you want cleaner look, use GeometriX's idea

    Oh, almost forgot the file

  • Use System -> Compare variable.

    Like this:

    Variable key is equal to 1 -> Door collision disabled (or whatever way you use to set door open)

  • Kcpunk666 Ok, i removed it, gave little fps boost but it's still dropping below 50 fps . Any trick for getting the fps to 60? Thank to dcrew for making it only render blocks that are on screen, otherwise performance would be awfully low.

  • You should probably set it to run as admin, for me it threw errors when running without admin rights.

  • Kcpunk666 Yes, I'm using physics

  • Hi!

    I'm making a multiplayer OUYA game with random map for every match. So my problem is that the performance is horrible.

    The map is quite big, maybe 450 tiles, and C2 checks collision for all of them(~20k checks/sec). I only need it to check the collision for the objects that are on screen. I'm using this method to generate the map.

    I changed some properties in the method above:

    • Spawning max 3 blocks on top of each other
    • Not spawning trees
    • No biomes
    • Added collision
    • 150 x 150 px textures

    So what should I do in order to get it run well?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi!

    How can I get the input from both analog sticks on Ouya pad? I saw one image that shows what every button is in C2. But it didn't show how you get the input from analog sticks. And some guy posted that you can't get input from left analog stick. Is that true or has it been fixed?

  • Bump...

  • Hi!

    I'm trying to make a program that would let you draw and send it to other people over internet. I decided to use Socket.io. So, I learned how to use Socket.io and I coded the server.js file.

    var io = require("socket.io").listen(8080);
    var map = "no";
    var angle = 0;
    var posx = 0;
    var posy = 0;
    var color = "";
    
    // All functions that can be called from client
    
    // This happens when user connects
    io.sockets.on("connection", function (socket) {
    
         // Telling to the client that connection is established
         socket.emit('message', "welcome");
         
    
         // Clears the canvas for everybody
         socket.on("clear", function () {
              angle = 0;
              posx = 0;
              posy = 0;
              color = "";
         });
    
         // Refresh canvas when somebody draws
         socket.on("update", function () {
              socket.broadcast.emit(angle, posx, posy, color);
              console.log("Sent!");
         });
    
         // Handles map choosing
         socket.on("chosen", function (data) {
              map = data;
         });
    
         // Sends map name to client if map is chosen
         socket.on("map", function () {
              if (map == "no"){
                   socket.emit('message', "no");
              }
              else{
                   socket.emit('message', map);
              }
         });
    
         // Gets pen's angle from client
         socket.on("angle", function (data) {
              angle = data;
              console.log("Angle from client!");
         });
    
         // Gets pen's position on x 
         socket.on("posx", function (data) {
              posx = data;
              console.log("PosX from client!");
         });
    
         // Gets pen's position on y
         socket.on("posy", function (data) {
              posy = data;
              console.log("PosY from client!");
         });
    
         // Gets pen's color
         socket.on("color", function (data) {
              color = data;
              console.log("Color from client!");
         });
    });
    

    Everything was fine, until the client side event making. The server gets the data and sends it, but I don't really know how to process that data client side. It should cut every piece of data at "," and color at ";". Tried tokenat and sockets slicing, but nope, not working.

    And also, Socket eventing seems to destroy this drawing method. I've been struggling with this problem for days and I'm desperate. Any help is highly appreciated!

  • Just one question, how can I change the color of the line. I can change the color of all the lines at the same time but i can't change them individually.