dop2000's Recent Forum Activity

  • Maybe the area you think is transparent is not really transparent. (maybe it's white or black or semi-transparent)

    Use "Browser Log canvas.alphaat(x,y)" to check alpha value in different points.

  • You do not have permission to view this post

  • R0J0hound, well, OP never explained what he needed this for. Based on his question if he could use 1px sprites, I assumed he wants to generate something like a solid terrain from custom images.

  • If you want the gravity to be constant, then on collision increase bullet speed. For example:

    set Bullet speed to (Self.Bullet.Speed*1.5)

    If you want to change gravity:

    set Bullet gravity to (Self.Bullet.gravity*0.75)

  • One of the ways to fix this is to add an invisible sprite ShipBase. This will be the object that player will be controlling, so move Drag&Drop behavior to ShipBase sprite. Also move the "Bound to layout" behavior to ShipBase. Set ship position to ShipBase on every tick.

    When you attach other parts to the ship, adjust ShipBase size accordingly, so it would always cover the entire ship.

    .

    If your ship is irregular shape (not rectangular) and it can rotate, then the above method will not work. In this case it may be easier to add several frames/animations to the ship sprite for different ship configurations. For example, first frame for ship with no attachments, another frame for the ship with attached weapons, another frame for the ship with attached engine, another frame for both weapons+engine attached. The image in all frames can be the same, but the size of the frame and collision polygon will be different.

    Here is an example:

  • You need to paste the red image to canvas object. And then use alphaAt or redAt expressions to detect the shape of red image.

    See this demo (you need to install Canvas addon for it):

    dropbox.com/s/u95o1fwrdcz7if7/CustomShapeObjectWithCanvas.capx

    .

    Note that this method is quite slow and only suitable for small images. To improve performance, use bigger tile size (2x2, 4x4 etc.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • System compare two values

    mid(text, index, 1) not equal " "

  • Remove/disable everything and try this simple code:

    Is touching LeftButton -> Player simulate pressing Left
    
    Is touching RightButton -> Player simulate pressing Right
    
    Is touching JumpButton -> Player simulate pressing Jump
    

    If it works fine, then you can add sub-events to each of those 3 events, in which you can check if player is on the floor and change animations if necessary.

  • And why do you need to do that?

    If the red area consists of 3 rectangular sprites, it's farily easy.

    If it's one sprite, you will need to define its collision polygon, and then it will be possible to fill it with small sprites or tilemap.

    If you can't change the collision polygon (for example for images loaded at runtime), then you will need to use Canvas plugin to detect pixels.

    .

    Having thousands of 1*1px sprites is a bad idea, it's better to use tilemap, see examples in this post:

    construct.net/en/forum/construct-2/how-do-i-18/simple-scorched-earth-worms-ga-129595

  • Why do you want to do this? If you need to change the color of red area, there are much easier ways - you can use "Set color" effect or blend modes.

  • Use "Is touching object" events to move left or right and "On touched object" event to jump. Also, I suggest previewing your project in Chrome, as Firefox doesn't work well with multi-touches.

    See this tutorial:

    scirra.com/tutorials/4973/multi-touch-movement-controls

    .

    If all of the above doesn't help, please post your capx file.

  • Also, to make the final part of the lerp faster you can increase the destination value a bit. So if you want to zoom from 0.5 to 1, instead of this:

    set scale to lerp(layerscale, 1, dt*10)

    do this:

    set scale to min(lerp(layerscale, 1.1, dt*10), 1)

    lerp will be changing the scale to 1.1, but the min() function will stop it at 1.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 259 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies