aridale's Recent Forum Activity

  • I dont think your spose to use the mouse plugin and the touch plugin together are ya?

  • if you can just POST it to php from the game wheres the problem?

  • I just saw this on another forum I goto all the time. Im gonna do the 99$ one

  • youd have to get it via ajax. Thats why I made my login with c2 instead

  • if all your frames are in the same sprite then you dont need an array to CREATE the tiles you just can use the array to store what tiles are where.

    The best way to go about randomly making this like you want is to generate the streets on a grid first then generate anything else in the places streets arent.

    The first thing you need is a layout evenly sized for your tiles. If the map can be 20 tiles wide then the layout needs to be the width of the tile*20 wide. Same for height.

    Now instead of thinkin in terms of x and y location you can think in terms of location on a grid (layout.width/tile.width = number of columns in the grid. layout.height/tile.height = number of rows)

    To generate your roads you need to start at a location on your grid (probably a corner or edge) and then place a road tile. Now you know that if your road is going left/right then you need to put another road tile up or down to make the full road. Thats upto you how you want to do it but you need to do it that way every time a road tile is made goin left or right.

    Now you need to randomly decide a direction for the next part of the road. You can do that with choose() or random() or however you want to set it up. But randomly pick a direction (going any direction but the one you went last aka if the last road was placed right you dont wanna go left this time just up down or right again)

    When you get to another edge or corner you know your roads done. That will generate one random road. Do it again from a different starting location to make another road etc.

    Its not the best or fastest way to do it but its a good way to get you started with randomly generated content. Once its working you can tweak it to make it do things like generate intersections and instead of makin 1 road at a time you can make it generate a new road everytime it makes an intersection.

    The main things are

    • use a grid dont worry so much about the actual x,y values. You DO need em to place the tiles in the right part of the grid but dont try to use those to generate the locations
    • You can use an array to store the tile in the same location in the array as it is in the grid (the grid is really a 2d array) then use this array to tell exactly whats where or whats empty (for makin buildings and stuff between roads)
    • dont generate over what youve already generated (dont go left if you just went right)
    • if you need somethin made with each tile generated do it then. Dont try to go back and do it after its generated. Like the other part of the roads in your case. Itll save you headaches down the road.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yeah its really really simple

  • there is?! All I know about is the dialogbox one. Id love to be able to write to the console! I use alert windows for all my debugging lol

  • the only problem with this kinda thing is you dont want the sprite used for the selection box to stretch. If you make a 1 pixel thick hollow square on an image then stretch that sprite to twice its original size then that 1 pixel thick border becomes 2 pixels thick.

    Maybe not a huge problem... possibly a very a big problem depending on the project. Either way it looks bad

    The way its normally drawn is with frame images. 1 for each corner 1 for each side and 1 for the middle which is usually tiled not stretched. Not an easy solution to setup in c2 tho

  • I think a bit less strict about how it checks things in general would be great. Maybe a toggle for expert mode? So you can move things around and not have to worry about half an event sheet gettin deleted cause the variable moved

  • also you can move thru global and local vars with the arrows but cant hit Enter to edit them

  • oh ok I didnt know stuff wasnt in the same spots in the generated runtime Ill remember that if I have to report anything else like this =D

  • its in LoadURL in the sprite plugin runtime.js

         Acts.prototype.LoadURL = function (url_, resize_)

         {

              var img = new Image();

              var this_ = this;

              var curFrame_ = this.curFrame;

              

              img.onload = function ()

              {

                   curFrame_.texture_img = img;

                   curFrame_.offx = 0;

                   curFrame_.offy = 0;

                   curFrame_.width = img.width;

                   curFrame_.height = img.height;

                   curFrame_.spritesheeted = false;

         -->          curFrame.datauri = "";

aridale's avatar

aridale

Member since 7 Dec, 2011

None one is following aridale yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies