Flirt without Impact


  • Patron

    haha
    After seeing @David’s Impact tank game I was wondering how hard would it be to make a similar game, without Impact, Box2D or any of these fancy stuff.
    Turns out it was not that hard!
    I can’t belive I just wasted 3 hours of my life doing this, but at the same time I’m kinda proud of myself XD

    “Features”:

    • Non-ideal collision system!
    • Blocks which don’t block anything!
    • Resized tank images!
    • Graphics!
    • Multiplayer!
    • No annoying sound effects!
    • 432 lines of code!

    Player 1 controls:

    • WASD to move
    • Spacebar to shoot

    Player 2 controls:

    • Arrow keys to move
    • Shift to shoot

    Player 3 controls:

    • IJKL keys to move
    • P to shoot

    Play it here!


  • LDG

    You better be careful or you’re gonna get a cease and desist letter from @david! ;)

    That is very impressive, nice work! Game dev level up?


  • Patron

    @richtaur said:

    You better be careful or you’re gonna get a cease and desist letter from @david! ;)

    What?!
    It’s impossible to determine if I stole his graphics or not!

    That is very impressive, nice work! Game dev level up?

    Impressive? Oh, c’mon, you’re just being nice aren’t you?
    I bet you could do this in half an hour in Djinn!
    Or maybe I just have impostor syndrome…

    Anyways, thanks :D
    Yeah, I hope this is a level up.
    Right now I wanna add pixel-perfect collision, because the collisions are really bugging me, but I have tons o’ homework to do, so…


  • Patron

    @Josue said:

    • No annoying sound effects!

    Hey!!

    Seriously though, this is really cool, @Josue ! Comparing the sizes of our dependencies (Impact+Box2D+LoDash for me VS just sat-js for you), your few lines of code are really putting mine to shame. Well done! :)


  • Patron

    @David said:

    @Josue said:

    • No annoying sound effects!

    Hey!!

    Seriously though, this is really cool, @Josue ! Comparing the sizes of our dependencies (Impact+Box2D+LoDash for me VS just sat-js for you), your few lines of code are really putting mine to shame.

    sat-js? What?!

    Oh, now I remember…

    I was trying to integrate sat-js to make the collision less crappy, but I gave up.
    That’s why the collision is so crappy.
    So, actually, I’m not using any dependencies.

    All the collision testing/solving is done with circles.
    This is the function which does that:

    collide : function(solid,callback)
    {
     for(x in game.activeobjects)
     {
      var object = game.activeobjects[x];
      if(object.collisiongroup !== solid.collisiongroup)
      {
      
       var centerVector = new game.Vector({x : object.x, y : object.y},{x : solid.x, y : solid.y});
         
       var solve = function()
       {
        if(callback) callback(object,solid);
        centerVector = centerVector.divide(centerVector.length());
        centerVector = centerVector.multiply(solid.radius + object.radius);
        solid.x = centerVector.startCord.x + centerVector.x;
        solid.y = centerVector.startCord.y + centerVector.y;
       }
       
       if(centerVector.length() < object.radius + solid.radius)
       {
        if(solid.bloco === true && object.bloco === true)
        {
         solve();
        }
        
        if(solid.bloco === undefined && object.bloco === undefined)
        {
         solve();
        }
        
        if(solid.bloco === true && object.bloco === undefined)
        {
         solve();
        }
        
       }
       
      }
       
     }
    

    (yeah, I tend to mix portuguese and english on my variable names)

    Well done! :)

    Thanks man!
    I’m every time more convinced that the only hard part of coding is knowing what you want to code.
    So, you just gave that to me.


  • Patron

    Ah, that explains why I didn’t see how you used it when I glanced through the code! And yeah, that makes it even more impressive.

    And also a good example of what you just said, knowing what you want is the most important thing! I definitely often fall into the trap of hunting for the best tool, right framework and the magic bullet, but as you just proved, in the end it comes down to me anyway… :)


  • Patron

    @David said:

    And yeah, that makes it even more impressive.

    @richtaur said:

    That is very impressive, nice work!

    Oh, c’mon guys, it ain’t that impressive…
    I mean, just look at the code!


  • Tiger Hat

    @Josue said:

    @David said:

    And yeah, that makes it even more impressive.

    @richtaur said:

    That is very impressive, nice work!

    Oh, c’mon guys, it ain’t that impressive…
    I mean, just look at the code!

    Exactly - YOU HAVE WRITTEN SOME CODE.

    Most people on the planet cannot do that.

    Your code makes a game, and you have done it in three hours. Well done!

    Give me three hours and a computer and these days a I tend to complain about being tired then go and look at fail compilations on youtube!

    We’re proud of you - you should be too :D


  • Patron

    @cheersphilip said:

    @Josue said:

    @David said:

    And yeah, that makes it even more impressive.

    @richtaur said:

    That is very impressive, nice work!

    Oh, c’mon guys, it ain’t that impressive…
    I mean, just look at the code!

    Exactly - YOU HAVE WRITTEN SOME CODE.

    Most people on the planet cannot do that.

    Your code makes a game, and you have done it in three hours. Well done!

    Give me three hours and a computer and these days a I tend to complain about being tired then go and look at fail compilations on youtube!

    We’re proud of you - you should be too :D

    Should I be proud of myself because I can do something the average person can’t?
    I don’t think so…
    I should only be proud of myself if I did something substantially harder than what my past self could do.
    If @David posted this three months ago, my three month past self could probably do the same thing.

    That’s what I was talking about with @David, once I’m confident about and idea, I can implement it in no time.
    But being confident about a game design idea is impossible to me.

    That’s what I’m pursuing…

    With that said, I appreciate all your nice comments! :D


Log in to reply