dop2000's Forum Posts

  • Project -> Files -> right click -> Import files

  • This task shouldn't be too hard.

    When a second touch is registered, save distance between two fingers in a variable.

    Then on every tick calculate new distance between two fingers and adjust zoom accordingly.

    Make sure that none of the other touch event in the game are triggered while player is zooming.

  • I tried it before posting - a loop with 360 LoS checks on every tick, I was getting steady 60FPS.

  • CSV plugins are great, I'm using them a lot in my games:

  • Swallowing - you can do it with animation, create a sequence of frames where the enemy is getting smaller. Run this animation and move enemy towards the player with bullet behavior. At the end of animation, destroy the enemy.

    Or use Sine behavior to change scale.

    Or you can do something like this:

    For x=1 to 10
        Wait loopindex*0.1
        enemy Set Scale to (1-loopindex/10)
        enemy Move at angle (angle(enemy.x, enemy.y, player.x, player.y)) distance (10)
    [/code:2tfq2ixj]
    
    It's just a random example, you may need different values for wait, distance etc.
    
    Spitting - you can simply create a smaller clone of enemy sprite, add Bullet behavior and shoot it as any other bullet. 
    (see Shooter sample projects in C2)
  • newt

    Is there ObjectB?

    I thought facecrime wanted to find a random point on the layout not visible to character. Probably to spawn an enemy there or something like that. Maybe I misunderstood the question.

  • Here you go:

    https://www.dropbox.com/s/5z3l8ud2nn2uj ... .capx?dl=0

    I optimized your code and layouts a bit.

    Global variables were probably not the best choice for storing these values.

    You can replace them with a dictionary. This will allow you to access any of them by ID, for example:

    MyDictionary Set Key ("Value" & Str(slid_line.ID)) to 70

    With dictionary you'll be able to loop through values, easily save to local storage etc.

  • I would do this:

    RADIUS=   [minimum distance from the character]
    r=int(random(360))
    For x=r to r+360
       xFound=character.X+RADIUS*cos(loopindex)
       yFound=character.Y+RADIUS*sin(loopindex)
    
       Character has NO LoS to (xFound, yFound)
            Stop loop
    [/code:2a553ctr]
    
    This will give you a random point at RADIUS distance. (a random line out of sight) 
    Then, if you wish, you can move this point further from the character along this line.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set X to

    slid_line.X+unlerp(slid_line.minVal,slid_line.maxVal, Value0 )*slid_line.Width

    And, of course you need to pick each slide bar and use different variables in the formula - Value0, Value1 etc.

  • Try adding debug output ("Browser->Log") to these events, to make sure they are triggered at the right moment.

    If they are triggered, then maybe your rolling animation gets overridden by a different animation - idle, walking, running etc.

  • Move second condition where you comparing a variable to a sub-event and use Else:

    On tap gesture on btn
    
        System avatarPicked=3  -> .........
        
        Else
        System avatarPicked=4  -> .........
    
        Else
        System avatarPicked=13  -> .........
    [/code:3qkv17ti]
    
    Or you can actually compress all this code into a single expression using [url=https://en.wikipedia.org/wiki/%3F:]ternary operator[/url]:
    avatarPicked= (avatarPicked=3 ? 4 : avatarPicked=4 ? 13 : avatarPicked=14 ? 21 : 0)
    avatars Set animation frame to (avatarPicked)
  • So you have something like this:

    Enemy2 spawn Enemy1

    Enemy2 destroy

    Add another action before destroying Enemy2:

    Enemy1 set Bullet angle of motion to (Enemy2.Bullet.AngleOfMotion)

  • Instance variable is the easiest way to do it. You can also try something like this:

    build a string with UIDs of all picked instances in the first function and pass it as a parameter to the second function.

    Make sure to separate UIDs with some character, say "#".

    In your second function pick the same set of instances using find(function.param(0), "#"& str(Sprite.UID) &"#" )>-1

  • Oh, you are using a custom slider bar.

    Just calculate the position of slid_btn using the Unlerp() function, same as you do in "TextBox->On Text Changed" event.

  • worm1

    To open a capx saved in newer version, rename it to zip, unpack to a folder, open .caproj file in Notepad and edit this line:

    <saved-with-version>24700</saved-with-version>