rfisher's Recent Forum Activity

  • I'm making a behavior and i passed the contents of the tick function through the Google Closure Compiler. The results are that it appears faster, but the code is virtually unreadable. Has anybody else tested the Google Closure Compiler to optimize their code and what results did you get?

    Disregard, it looks like this is already being done. http://www.scirra.com/forum/plugin-developers-please-test-with-the-minifier_topic45502.html

    My next question would be, do i have care about optimizing my code since its being pushed through the Closure Compiler?

  • 00Rez

    How will this handle objects/obstacles that move?

  • Ashley

    Thank You

  • var loccnt = 0;

    this.inst.y += this.Mazenavdistance;

    this.inst.set_bbox_changed();

    var collobj = this.runtime.testOverlapSolid(this.inst);

    if ( collobj )

    {

        loccnt += 1;

    }

    this.inst.y -= (this.Mazenavdistance*2);

    this.inst.set_bbox_changed();

    var collobj = this.runtime.testOverlapSolid(this.inst);

    if ( collobj )

    {

        loccnt += 2;

    }

    this.inst.y += this.Mazenavdistance;

    this.inst.x += this.Mazenavdistance;

    this.inst.set_bbox_changed();

    var collobj = this.runtime.testOverlapSolid(this.inst);

    if ( collobj )

    {

        loccnt += 4;

    }

    this.inst.x -= (this.Mazenavdistance*2);

    this.inst.set_bbox_changed();

    var collobj = this.runtime.testOverlapSolid(this.inst);

    if ( collobj )

    {

        loccnt += 8;

    }

    this.inst.x += this.Mazenavdistance;

    this.inst.set_bbox_changed();

    This is the code i'm using to check if there is a solid object in the up, down, right, and left direction. It seems slow to actually have to move the object to the location and then check to see if its overlapping. I would like to use the

    runtime.testAndSelectCanvasPointOverlap function, but every attempt has failed(javascript error). I did look at the mouse plugin, but it didn't help me solve the problem.

    Any help

  • I'm trying to use the function

    runtime.testAndSelectCanvasPointOverlap(type, x, y, inverted)

    to test if a point is overlapping a solid. I'm having trouble with not knowing what is returned by this function and referencing the type variable.

    I gave up on using this function and used

    runtime.testOverlapSolid(inst)

    But this seems the wrong way to go about this.

    Any Help

  • Joannesalfa

    <img src="http://www.jenpop.com/demos/draw2sprite1.png" border="0" />

    This is how you used the plugin. The format for the set string is (x,y,direction(l,r,u,d),distance).

    <img src="http://www.jenpop.com/demos/draw2sprite2.png" border="0" />

    Here is a example of it working.

    I guess i need to put some error checking into the string parsing part of my plugin.

  • Yanen

    * MY COLS AND ROWS ARE BACKWARDS IN THE PLUGIN *

    Here is a live demo show what the post exception string can do.

    Live demo

    CAPX

    The post exception string for this maze is "0,3,8,5,0,1,8,3,2,5,5,4"

    3 numbers seperated by commas make up one exception. The first number represents col. The second number represents row. The third number represents the wall of the maze cell to remove. Think of the cell as a box with 4 sides. The top side is defined as 1, right side as 2, bottom side as 4, and the left side as 8.

    Also note that this maze dimension is 6x9 and when you reference a cell its done like you do an array, (0,0) is the upper left corner and (5,8) is the lower right corner.

  • Joannesalfa - send me a capx

    draw sprite set string examples:

    "10,10,dul,3" - draw sprite at x=10, y=10, diagonal upper left 3 sprites.

    "10,10,dur,3" - draw sprite at x=10, y=10, diagonal upper right 3 sprites.

    "10,10,dll,3" - draw sprite at x=10, y=10, diagonal lower left 3 sprites.

    "10,10,dlr,3" - draw sprite at x=10, y=10, diagonal lower right 3 sprites.

    "10,10,ulc,3" - draw sprite at x=10, y=10, upper left corner 3 sprites.

    "10,10,urc,3" - draw sprite at x=10, y=10, upper right corner 3 sprites.

    "10,10,llc,3" - draw sprite at x=10, y=10, lower left corner 3 sprites.

    "10,10,lrc,3" - draw sprite at x=10, y=10, lower right corner 3 sprites.

    "10,10,l,3" - draw sprite at x=10, y=10, left 3 sprites.

    "10,10,r,3" - draw sprite at x=10, y=10, right 3 sprites.

    "10,10,u,3" - draw sprite at x=10, y=10, up 3 sprites.

    "10,10,d,3" - draw sprite at x=10, y=10, down 3 sprites.

    You can chain these strings together.

    Another CAPX more examples

  • bowiz2

    I added how to use the maze part of the plugin. I will add the other soon.

  • I forgot to detail how to use the plugin. I will start with the maze options.

    Object = the sprite used for the maze

    Layer = is the layer number or name of the layer

    X & Y Grid size = The size of each section of the maze. How many objects/sprites used per rows and cols.

    Rows and Cols = Defines how many rows and cols make up the maze.

    X and Y postion = define the x,y position of the maze based on the upper left corner.

    Width & Height override = allows you to override the spacing of the sprite.

    Post Exception String = is used to remove part of the maze after it is created. Its like "row,col" which could be "2,3"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I released the plugin

    link

  • <font size="4">* MY COLS AND ROWS WERE BACKWARDS IN THE PLUGIN FIXED NOW*</font>

    I have created a plugin called Drawsprite.

    you can do the following:

    Create a random maze with 1 event

    Draw a sprite path

    Draw sprite lines at any location

    Draw with 2 different sprites

    You draw with a string that defines what is drawn.

    Drawsprite Plugin

    Example CAPX

    Live demo

rfisher's avatar

rfisher

Member since 1 Apr, 2012

None one is following rfisher yet!

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies