deadeye's Forum Posts

  • Ah, your demo .exe works as advertised. Not bad, though the sword swinging seems a little slow to me. Don't know how you're going to translate that into sprites, either. Could be a bit tricky.

    Anyway, it seems to be coming along so kudos

  • On a side note, deadeye, just for my clarification, when you said aSprite and bSprite, did you think I had the same sprite as two seperate objects? If so, that was my mistake of clarification. I have a single sprite object placed randomly on the screen, multiple times using a Loop proceedure.

    Nah, that wasn't your fault. It was my fault for reading it wrong.

    Happens a lot, I'm always answering the wrong questions

  • Timedelta is the number of seconds between ticks. It's a very low number. The number changes slightly from tick to tick because processing speed may vary.

    Anyway, if your fps is 60 and you say "subtract 60*timedelta" to something, it will average out to subtracting 1 every second. So in that timer example I posted, you set the timer to 2, and subtract 60*timedelta, that means the timer will run out in two seconds.

    If instead you told Construct to "Always -> subtract 1 from timer" then on very fast computers the timer would be shorter than two seconds, and on very slow computers it could be longer than two seconds. Timedelta makes sure it's the same on all computers.

    But yes, mostly it's used for moving things around to make sure stuff runs at the same speed on all computers. All the built-in behaviors use timedelta automatically.

  • .cap file is blank

    No it's not... try opening the Level1 layout

    Anyway, the problem is you're trying to use physics collisions, but you're not telling the player to move using physics movement. You're telling the player to move using set pixel amounts. Physics doesn't work that way.

    If you are using physics, you can only tell physics objects to move using force or acceleration in the physics tab of the actions for the object. You can only tell the physics object to rotate using torque or angular velocity.

    You cannot tell a physics object to "rotate n degrees" or "move n pixels." You're doing it wrong.

    Basically it works like this: The Physics behavior is a simulation. It runs all the collisions in the behavior itself. It's a totally separate thing from 8Direction or Platform interacting with solid objects. Physics doesn't care if an object is checked "Solid."

    Physics objects only collide with other physics objects, period.

    If you want physics objects to collide then you need the physics engine to do the work for you. If you tell the sprite to "move n pixels" then it totally skips the physics engine and move the pixels like you asked. But the physics engine doesn't know you just move the sprite. It doesn't know you just intersected with a solid. Moving those pixels is not part of it's simulation. The physics engine still thinks the sprite is sleeping away perfectly still where it started off.

    Anyway, long story short: Physics and regular pixel movement (including other behaviors) don't mix. Physics only works with physics.

  • You know what I just remembered? The Bitmap Font object in MMF had a font creator built into the object. You could pick from the list of fonts installed on your system, change the color, size, add some simple effects like drop shadow or outline, italics, or whatever, and it would rasterize the font for you. (Or you could load one up from a sheet as well, I think.) For simple fonts that might be a way to go, yeah?

    Or... I know David's unfinished Tile Map object let you load a tile sheet, and you could tell it what grid size the tiles were, and then place tiles in the layout by selecting them. Perhaps the spritefont object could use the same kind of sheet-loading system? And maybe there could be a standard for importing sheets, like all the letters, numbers, and symbols are in the same relative position, and you just have to plug in what the grid size is for your sheet. That way you could even include a template that people could resize to fit their font and they could place the letters on the grid and save the image in Photoshop or GiMP or whatever to import.

    I dunno, just a thought. I'm sure it's already way to complicated without having to think about that kind of stuff . And I'm about to go to bed so I'm all groggy and I'm rambling, sorry...

  • Wellokayfine you have a good point about the counter object

  • Path movement should be a plugin or behavior, not necessarily just for sprites. It has been requested a few times. Would be nice to have.

    Counters can be made with anything by adding and subtracting private variables. It is totally not necessary to have a separate counter object.

    Gamepad support is a big thing. Currently there is none except for XBOX360 controllers. It's been requested a lot, and hopefully someone will make a plugin before 1.0.

    Hiscore object? Why? What would it do that you can't already do with Construct? You could store your own high score info in a file with encryption if you wanted. You don't need a separate object for that either.

  • Okay then, I did misunderstand. I read over the OP three times and somehow still missed that he was colliding instances of the same object with each other.

    Yes, the family trick will work just fine for this.

  • I don't think you would need bones, and I don't think that sprite is going to have too much effect on VRAM.

    What is confusing is what it's doing. I have no idea how that thing is supposed to move or attack.

    What you should do, if you know how it should move, is separate the frames into their own animations. That's the first step.

    Second, create a timer to control when it switches from moving to attacking. Or for when it switches from attack 1 to attack 2, etc.

    Third, when the enemy is activated (like, when it's on the screen) start the timer. When the timer counts down, switch modes.

    When one mode is active (you can use a "mode" variable for this) then perform only the actions that it should be performing.

    Something like so:

    + Scorpion is On Screen (or whatever)
    + Trigger Once
        -> Scorpion: Value('active') to 1
        -> Scorpion: Set Value(myTimer') to 2
    
    + For Each Scorpion
    + Scorpion.Value('active') = 1
        + Scorpion.Value('myTimer') > 0
            -> Subtract 60*timedelta from Scorpion.Value('myTimer')
    
            + Scorpion.Value('myTimer') <= 0
                -> Scorpion: Set Value ('mode') to random(3)
                -> Scorpion: Set Value ('myTimer') to 2
    
        + Scorpion.Value('mode') = 0
            -> Do movement actions
    
        + Scorpion.Value('mode') = 1
            -> Do attack 1 actions
    
        + Scorpion.Value('mode') = 2
            -> Do attack 2 actions
    [/code:12mit8ay]
    
    Obviously this is just the theory part of it, you will need to fill in the blanks.  But something like this will make it so that every 2 seconds the scorpion will pick a random "mode" and then you can use that mode variable to control what it's doing, whether it's moving, shooting a bullet, playing the proper animation, or whatever.
    
    This single "mode" setting is what's known as a state machine.  You basically boil down everything that the enemy can do into separate chunks, and pick one state, or "mode," at a time to control which chunks are being processed at that moment.  This is a very simple version of a state machine, they can get rather complex, but they do make things a lot easier when doing things like AI and controls and animation.
    
    Also, you don't necessarily have to use a timer, like I showed.  You can set the state based on whatever you like, such as an animation finishing.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you're using instances of the same sprite then selecting a particular sprite that is being collided is as simple as picking it in the collision event:

    + On collision between aSprite and bSprite
       -> Set global('aFoo') to aSprite.Value('life')
       -> Set global('bFoo') to bSprite.Value('life')
    [/code:2svmipbv]
    
    The On Collision event places both instances of the sprites into Construct's Selected Object List (the SOL).
    
    Any actions will be performed only on the instances that are on the SOL.  If there are no instances on the SOL, (i.e., you have not picked them with conditions) then any actions will be performed on ALL the instances of the object.
    
    If you are pulling info from an instance in an expression (such as the 'life' value) and that instance is on the SOL, then the info will be pulled from that instance.  If there is no instance on the SOL, then the info will be pulled from the earliest instance that was created.
    
    I don't know what Daiz means by using families, unless I'm misunderstanding something.
  • You cant draw to the Construct window. At least thats the way I understand it.

    Silly banana! Is Canvas so easily forgotten?

    You can draw all sorts of things.

    I've only had one friend try it, though, so if anyone with a tablet wants to help - it's rather featureless, but - here is a 7z and a zip of the test application. They are identical. In reality, people without tablets should be able to test it as well. If it's all bundled correctly, it should not pop up any errors when loading the exe.

    http://dl.dropbox.com/u/398143/Files/PressureTest.zip (1,906 KB)

    It works! Reads my tablet pressure just fine and dandy.

    You should change the thread title to "Tablet pressure test in Python" if you want more people to try it... the current title is rather ambiguous.

  • What version of Construct are you using? Because it doesn't seem to work right at all in 0.99.82. The sword just sort of vibrates and it's always sticking out to the right.

    Edit: Actually, it doesn't seem to work right in .72 either. The sword doesn't even appear when I press D.

  • The aliens in GUYMAN HERO face the proper direction, but now they run backwards

    You may be surprised to hear this but when I opened up the .cap you sent me in 0.99.72 for the first time (this was before 0.99.8 was even released), that's exactly what happened. I didn't mention it because I thought that either you sent me a different earlier build where the enemies weren't fixed yet or you had done that on purpose for some reason like, to make testing easier for me

    Anyway, as various builds get released, some small changes may occur from build to build that don't necessarily break your .cap, but make it so you have to tweak your .cap back into proper shape. I made Platform School in 0.98.9, and when I updated it in 0.99.8 I had to change all the swimming settings because there were new "Jump gravity" and "Jump sustain gravity" settings, and it appears that the values for acceleration and deceleration in the behavior had been changed as well so he was swimming really weird. So I guess as long as you can at least fix it, then everything should be okay.

    Wheee! Beta testing!

  • Why even use anything? Nothing really matters. Abandon all hope.

    This cheerful message brought to you by deadeye, brightening your days since 2007.

  • Platforming works great! But now some parts of my game work completely differently and i don't really know why. It might be the way i coded(evented?) things, though. Kinda hard to tell.

    What parts are different?