R0J0hound's Recent Forum Activity

  • When you run a script everything freezes until the script is done. I'd recommend avoiding sleep() because "time.sleep(1)" will cause a one second freeze every time it's used.

  • I threw a couple ideas into a cap, maybe one of them will help.

    http://dl.dropbox.com/u/5426011/examples2/parallax_ex.cap

    made in 0.99.96

  • Set the "zoom x rate" and "zoom y rate" of your HUD layer properties to zero. That way your HUD won't zoom at all.

  • Here's a non-python version with a different font for good measure:

    http://dl.dropbox.com/u/5426011/examples2/imagefont2.cap

    I originally was going to upload a non-python version like this but I had a random crash and lost the whole thing.

    Silent Cacophony

    This version no longer uses recursion and the objects do get destroyed now.

    EDIT:

    Here's where I'm getting the fonts:

    http://www.algonet.se/~guld1/freefont.htm

  • Here is an example of the using image fonts with the Tiled background object. It uses the "set image offset" action to select letters from the image. The only requirement is the image has to be power of two height and width.

    http://dl.dropbox.com/u/5426011/examples2/imageFontpy.cap

    made in 0.99.96

    This is not intended to be a replacement of Lucid's Sprite font object. But it gives the advantage of being able to load a different font at run-time with a single load image action, and the ease of editing all the characters in one image.

  • Here is a way to use Windows pop-up menus with python:

    http://dl.dropbox.com/u/5426011/examples2/pyPopupMenu2.zip

    made in 0.99.96

    No python install is required, all necessarily files are included.

    Notes:

    Had to use some event trickery so that when the menu was opened the timescale would remain 0 till the next tick. Otherwise objects that depend on timedelta would jump after the menu closed.

    This probably isn't very useful to most people using construct, but it's interesting none the less.

  • [quote:3qxdgnrk]How the hell do you get proper alpha right off the bat with these things?

    Convert the color mode of the PNG from Indexed to RGB. Then the transparency is preserved when the image is imported.

    [quote:3qxdgnrk]Now, the next main problem to make this viable is Z-Order. In other words, layers. Oh, yeah, and collision, I forgot. You either want some things to collide, or some things to not collide, basically...

    Z-Ordering is easy, just load each layer to a different layer.

    For collisions just set the collision mode for all the sprites on one layer to per-pixel and none on the other layers.

    Give the Sprite the Solid attribute and set it's collision mode to none.

    Here's a updated script:

    from xml.dom import minidom
    
    mapfile = minidom.parse(System.AppPath + 'ConstructTestMap.tmx')
    
    a = mapfile.getElementsByTagName('map')[0]
    
    width = int(a.attributes['width'].value)
    height = int(a.attributes['height'].value)
    tilewidth = int(a.attributes['tilewidth'].value)
    tileheight = int(a.attributes['tileheight'].value)
    
    #load all layers
    layernum=1
    for layer in mapfile.getElementsByTagName('layer'):
    	index=0
    	for tile in layer.getElementsByTagName('tile'):
    		val = int(tile.attributes['gid'].value)
    		if val > 0:
    			System.Create('Sprite',layernum,0,0)
    			if layernum==2:
    				SOL.Sprite.SetCollisionMode(3) # 3 is per-pixel
    			SOL.Sprite.x=(index % width) * tilewidth 
    			SOL.Sprite.y=(index / width) * tileheight
    			SOL.Sprite.SetAnimFrame(val)
    		index+=1
    	layernum+=1[/code:3qxdgnrk]
  • Arima, it does work but you need to add object folders from the project tab.

    <img src="http://dl.dropbox.com/u/5426011/pics/screen.PNG">

  • Python is the ideal route to take as it has good xml support.

    Here is a cap that will load the map that Candescence posted in the previous post.

    http://dl.dropbox.com/u/5426011/examples2/tilemapLoad.cap

    made in 0.99.96

    Be sure to put the cap in the same directory as the map. Also you might need to install python because the xml modules aren't included in construct.

  • The physics behavior doesn't use the solid attribute. It only reacts with other physics objects. Making a physics object immovable is all that it takes to make an obstacle. For a working example take a look at the physics template included with construct.

  • I think it's simple enough as is.

    For score:

    add a text object

    add a global variable and call it "score"

    create this event:

    + System: Always (every tick)
    -> Text: Set text to global('score')[/code:3m8kdybw]
    
    [u]For lives:[/u]
    add a tiled backdrop object and draw a 32x32 picture.
    resize to 32x32 after editing so you see only one image.
    add a global variable "lives"
    create this event:
    [code:3m8kdybw]+ System: Always (every tick)
    -> TiledBackground: Set width to global('lives')*32[/code:3m8kdybw]
    
    All the features of the KNP counter object are easily replicated with a variable and either a text object or tiled background object.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd recommend reinstalling/updating your graphics drivers.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound