bladedpenguin's Forum Posts

  • I would absolutely support such a system. It would be nice to upvote whenever someone helps me out with somthing!

  • Thats a good idea. Gotta love Containers! I think I'll end up with two separate sprites anyway. I'll have the Base for solid collisions, and the decoration, which detects collisions for z ordering and fade.

    I was a disappointed that nobody pointed me towards any documentation or tutorials on how Effects work in C2. I found plenty of tutorials online about glsl and other shader languages, but I really had to work for it and guess to figure out that GLSL was the language in question, or that the .fx files are fragment shaders, or that when I get the front color it is considered to be in a premultiplied state. I was able to find literally no documentation at all on how C2 handles shaders.

    Anyway, here is what I got:

    Anyway, I built the shader I wanted, and threw in X axis support for lulz.

  • I was thinking it would be cool for architecture to fade at the top when you walk behind it, but for it to stay solid at the bottom. I asked around, but noone knew anything, so i created a shader! https://www.dropbox.com/s/fv94dulcw62vl ... adient.png

    You can set the Opacity at the top, and you can also set the width of the gradient, in case the sprite is supposed to have a base that never fades. In this example, I have the opacity at the top set to 0 and the width set to 50%. I also threw in an X axis component just because.

    https://www.dropbox.com/s/5lja8h5cnwy7h ... addon?dl=0

    This does everything I need, but I think it would be good if I could reverse it somehow, so the faded part shows up at the bottom. It would make sense for it to do that when negative widths are entered, and it would be really easy to do this with an if statement, but I heard that branches are a bad thing to stick into the rendering pipeline. I'd love for some of the pros to weigh in and show me how it's done!

  • Sorry about the convoluted sentence structure. Cats and programming do funny things to the way I understand things.

    Are you tracking bonuses at the instance level or the global level? If you create a new variable for bonus things, it would make sense for it to have the same scope as the rest of your score related variables. I'm guessing global, but if its a multiplayer game you might be doing something different. So you have a new variable, called BonusRate. It starts at 0. Whenever you get a bonus, you add 0.1 to BonusRate and leave Score alone. Every second, you add BonusRate to score. That way, when you first start off, BonusRate is 0 and nothing happens to the score every second. After you pick up one bonus, BonusRate is now 0.1 and 0.1 gets added to your score every second. After you've picked up two bonuses, your BonusRate is now 0.2, and every second you get 0.2 extra points. If you get a third, it becoms 0.3 etc etc etc

    A different approach might be to track the number of bonuses picked up so you can ;display it to the player. Then, if you picked up 5 bonuses, your Bonuses variable is now 5, and every second you do Score = Score + Bonuses*0.1, so every two seconds you get a point.

  • Keep a variable to track the bonus rate. When first get an upgrade, it increases to 0.1. For the second, Bonusrate become 0.2 etc. Every second, add that bonus rate to the score.

  • Beautiful shaders! I have a request, if you don't mind making it. I'd like an effect that will cause an object to fade only on one side? When the player walks behind a pillar or something, I'd like it to go semitransparent. I could do this with a tween on opacity, but I think it would look better if the bottom of the pillar or tree or whatever stayed fully solid, while the top became translucent to show the player.

    I'd want the Opacity at the sprite's y=0 to be 0, and the opacity at the sprite's Y= height to be 100. Ideally, I'd want to be able to smoothly tween the effect on and off.

    Thanks for all your hard work!

  • Won't the fade gradient touch everything else on that layer? I ask because sometimes the player walks in front of stuff, so i have the player on the same layer as the architecture. I guess I could put the architecture a layer above when I need to fade and on the same layer when I need the player in front.

  • My workaround was going to be animations. Splitting into parts doesn't let me have a smooth opacity transition between the top and bottom. The problem with using animations is that it can't work with something that is already animated, like a swaying tree.

    Are you sure this is completely impossible? We have stuff like this?

    If the user's platform doesn't support webgl, I'll just deopacify the whole object.

  • Is there an effect that will cause an object to fade only on one side? When the player walks behind a pillar or something, I'd like it to go semitransparent. I could do this with a tween on opacity, but I think it would look better if the bottom of the pillar or tree or whatever stayed fully solid, while the top became translucent to show the player.

    I'd want the Opacity at the sprite's y=0 to be 0, and the opacity at the sprite's Y= height to be 100.

    If such a thing doesn't exist, could you point me toward documentation/tutorials on making effects?

  • My first thought would be to use steam's built in feature if you are on a PC, but I don't see a plugin for integrating Steam OR voip.

    I did a quick search for javascript voip solutions, and I found https://www.twilio.com/docs/howto, which might be interesting to turn into a plugin. I also found http://sipml5.org/, which may be more open and game friendly.

  • It lets you tile the inside or the edges, so one limitation is going to be that your size needs to be a multiple of the tile size so the inside lines up with the edges and corners.

  • I don't think you can use a family for this. I think you should create a spawning function. Create a array with 10 numbers in it, then when you spawn an object, pick one of those numbers and remove it from the list. if the number you picked was 1, spawn object1 etc. When an object1 falls off the bottom of the screen, add 1 back to the list and shuffle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would be inclined to get a half dozen tree sprites and stick them together in a semirandom fashion, breaking it up anywhere I see monotony. This uses up a bunch of spirtes, but unless you are taking up an inordinate amount of memory, or spending lots of CPU time on your slowest target platform checking for collisions, it doesn't matter.

    One alternative is a 9Patch. You can tile the inside, so trees overlap in an organic way, but the outside can be nonoverlapping with correct transparency. One of the difficulties there is that you can't rotate it without rotating the entire layer, but that isn't always a huge problem.

  • Your logic seems sound. To see why it's going "haywire" we need to see exactly what is happening, as well as the exact events driving it.

  • There doesn't seem to be a straightforward way to get the imagepoint offset, but you can (object.ImagepointX-object.X). Thus you can Object.SetX = Object2.X - (object.ImagepointX-object.X). Of course you can do it for both x and y at the same time with setposition.