R0J0hound's Recent Forum Activity

  • You don't need an array for this. Use a Sprite for the blocks as you said and give them an instance variable for the state. You can then make the grid of blocks by placing them in the editor or with events.

    global number grid_top=10
    global number grid_left=100
    
    start of layout
    for "row" from 0 to 9:
    for "col" from 0 to 9:
    --- create block at (loopindex("col")*block.width+ grid_left, loopindex("row")*block.height+ grid_top)

    Then you can do the targeting by saving the uid of a random block to a global variable. Then with events only check for bullets hitting that instance.

    global number target=-1
    
    target = -1
    pick a random block instance
    --- set target to block.uid
    
    every 1.0 seconds
    pick block with uid target
    --- "have the enemy shoot at block"
    
    pick block with uid target
    block is overlapping bullet
    --- destroy bullet
    --- subtract 1 from block state
    
    block state<=0
    --- destroy block
    --- set target to -1
  • Iggyboo

    My canvas plugin can be used for dynamic images and per pixel collision detection. It's not as simple as it could be but here are all the examples I could find:

    http://www.scirra.com/forum/how-do-i-simple-worms-game_topic47872_post300449.html#300449

    http://www.scirra.com/forum/destroy-Objects-parts_topic61035_page2.html

    http://www.scirra.com/forum/destructible-terrain-better-ideas-than-this_topic55053_post344054.html#344054

    Two of those have some kind of terrain generation if that helps.

  • was wondering if there is any compendium of the Construct syntax...

    http://sourceforge.net/apps/mediawiki/construct/index.php?title=Expressions

  • Allow me to disagree about the difficulty of a turn based game. The state of who's turn it is can be represented in a variable. Then use the variable compare condition in events to control when things happen. That is pretty much the main aspect that makes it turn based.

    After that you can tackle each other aspect individually. The computer AI will be the most difficult but is doable.

  • Do you mean you want to spawn a random object out of a set of objects?

    If so you could use the "create object by name" action and use

    {"man", "woman", "monster", 

    "kid"}wws@(random(4)+1)[/code] as the object type.

  • Well it would appear that find() does case insensitive searching, so "a" is the same as "A". So we have to work around that. Dictionaries have case sensitive keys so we can use that.

    First populate the dictionary with all the keys:

    global string chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.,:;'""?!()"
    start of layout
    repeat len(chars) times
    --- Dictionary: add key mid(chars,loopindex,1) with value loopindex

    Then change the formula to:

    Dictionary.Get(mid(Text.Text, loopindex, 1))

  • Arima

    I would like to eventually but I don't have much time as of now to do it. WebGL is straightforward enough but I will need to study C2's renderer to get it to work with effects. When I made the plugin webGL wasn't even on the table so with the 2d canvas most of the features were a piece of cake to implement. Getting it working with the webGL renderer is a lot harder and time consuming than "a piece of cake". It's more accurately somewhere between "a three course meal" and "an all you can eat buffet".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a bubble shooter capx a while ago. It also found connected bubbles with a flood fill algorithm. It only did it when a bubble landed as there is no reason to do it continuously. I also thought the lag to not be a problem because of when it occurs.

    Some ideas to make it faster:

    1. Lookup the capx I made and see if my implementation of flood fill is more efficient than yours.

    2. You could limit the amount of lag by doing the flood fill over multiple frames.

    3. As a last resort you could come up with some type of data structure to make the flood fill more efficient by making the picking of a bubble's neighbors a simple lookup instead of a collision check against all the other bubbles. In theory it will be much faster, but it will require a lot of events and be very tedious to setup.

  • Savvy001

    Just added save/load function. Re-download from first post. It is likely to be slow with larger images.

  • It's done the same way. The order of the animation frames should be like this:

    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.,:;'""?!()"

    or have what ever characters you wish to use. Then change the expression to not use lowercase():

    find("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.,:;'""?!()", mid(Text.Text, loopindex, 1))

  • You could use the 3dObject and change the textures with the texture Setter plugin and see if you get better performance with that.

  • I managed to get something working with python.

    http://dl.dropbox.com/u/5426011/examples17/ffmpeg.zip

    It extracts frames to a file and then loads it into a sprite. I'm getting about 15 fps on my machine.