Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: mini-tanks, an artillery 2d game with Tanks , inspired by Pocket Tanks.  (Read 18983 times)

0 Members and 1 Guest are viewing this topic.

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Introduction
Hi ,
This is an artillery , turn-based 2d game I made, which is far from complete yet but it does have some gameplay.
It is inspired from Pocket Tanks and Scorched Earth.
It features a fully destructible procedurally generated terrain , generated using simplex noise.
SFML is used for Window creation,Graphics and Input.

Controls and Objective:
Use mouse to click on the HUD to start setting Rotation(or press R) of the turret or power by moving your mouse left or right.
While setting rotation you'll see a cross hair helping you set the angle and
while setting power , the power gauge's outline will change from Black to Red.
Use Arrow Keys Left or Right to move the Tank.
Click on "FIRE" on the HUD or press Space to fire.
It is a very simple game , destroy other tanks and you win, with only one type of weapon.

Source:
Github: amhndu/tanks-game.

Compiling:
To compile you need a C++11 compiler( and also SFML 2.1 ).
Download the source or clone the repository from github :
https://github.com/amhndu/tanks-game
and use cmake (or cmake-gui)

Executables:
These are outdated.
https://www.dropbox.com/s/ixu8g65mszea4b4/tanks-bin-win32.zip (compiled using g++ 4.8.1)
https://www.dropbox.com/s/v4shlyt8j8odv4e/tanks-bin-linux32.tar.gz (compiled using VC 2013 and requires VC2013 redistributable)
These are statically linked 32-bit executables.

Video
http://www.youtube.com/watch?v=YbG_ej2fQKE

So try and what do you think ?  :D

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #1 on: April 26, 2014, 07:46:24 pm »
Oh look at that, totally reminds me of Worms (I love such games) ;)

Very cool stuff you already implemented!
What did you use for the landscape? A vertexArray which stores each pixel?
Whats the CPU cost? ( I tried something similar ages ago and had quite high CPU costs haha)

Keep it up and add more weapons pls!
Failing to succeed does not mean failing to progress!

zmertens

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #2 on: April 26, 2014, 09:34:22 pm »
That reminds me of Worms too. Cool!
The truth will set you free but first it will piss you off.

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #3 on: April 27, 2014, 03:46:34 am »
Oh look at that, totally reminds me of Worms (I love such games) ;)

Very cool stuff you already implemented!
What did you use for the landscape? A vertexArray which stores each pixel?
Whats the CPU cost? ( I tried something similar ages ago and had quite high CPU costs haha)

Keep it up and add more weapons pls!
I looked at different things but finally settled with using an image, you can look at the source.

Glad you like it.

The Illusionist Mirage

  • Full Member
  • ***
  • Posts: 115
  • My Life = Linux, C++ & Computers
    • View Profile
    • fleptic
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #4 on: April 27, 2014, 06:01:21 am »
Yea, really cool, and the video looks nice too. :)

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #5 on: April 30, 2014, 12:32:34 pm »
Yea, really cool, and the video looks nice too. :)
Thank you.

Any comments /advice on the source ?

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #6 on: May 04, 2014, 05:08:47 am »
Take a look at Scorched Earth, almost identically similar game. You might be able to pull some inspiration from it.

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #7 on: May 07, 2014, 05:10:44 pm »
I need a little help, can someone compile this game for Windows and provide a statically linked executable for windows 32-bit.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
AW: A game feat. Tanks , inspired by Pocket Tanks
« Reply #8 on: May 07, 2014, 05:26:10 pm »
A build script would be nice. ;)
If nobody beats me to it, I could build a Windows binary later this evening. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #9 on: May 07, 2014, 05:30:23 pm »
"GameSetupScreen.h" is missing
Failing to succeed does not mean failing to progress!

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #10 on: May 08, 2014, 04:42:06 am »
"GameSetupScreen.h" is missing
Sorry about that , seems i didn't commited it .You can clone the updated repo.
A build script would be nice. ;)
Well , I could have provided one but I do not know any cross-platform tools that could help me. :( Anyway I think this is a good time for me to learn cmake I will try and make one build script.
I used my IDE to do it for me.  :D
Also , to quote myself from my OP,
Quote
To compile , just compile all c++ files with a c++11 compiler( and link to SFML 2.1 ).
.
On linux , you can compile using these commands :
Quote
$ git clone https://github.com/amhndu/tanks-game
$ cd tanks-game
$ g++ -std=c++11 -O2 -o game *.cpp -lsfml-graphics -lsfml-window -lsfml-system -lGL -lGLU
Run :
Quote
$ ./game

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #11 on: May 08, 2014, 10:31:53 am »
Here you go: https://dl.dropboxusercontent.com/u/8088302/Tanks.7z

Please check your code! I get tons of warnings (most of them because of missing type conversion, but still).
I also got some errors, which were easy to fix though.
Failing to succeed does not mean failing to progress!

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #12 on: May 08, 2014, 11:01:52 am »
Here you go: https://dl.dropboxusercontent.com/u/8088302/Tanks.7z

Please check your code! I get tons of warnings (most of them because of missing type conversion, but still).
I also got some errors, which were easy to fix though.
What errors ? I get none on g++ 4.8.1.

Thanks for helping me out.

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #13 on: May 08, 2014, 11:21:46 am »
What errors ? I get none on g++ 4.8.1.

Nothing big, you probably have a different warning level on your compiler (idk how it is called for your compiler) and mine does treat some warnings as errors too like:
deltaScroll = -menuList.size()+itemsVisible;
Which gives me error C4146 for example.
Failing to succeed does not mean failing to progress!

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: A game feat. Tanks , inspired by Pocket Tanks
« Reply #14 on: May 08, 2014, 12:23:18 pm »
What errors ? I get none on g++ 4.8.1.

Nothing big, you probably have a different warning level on your compiler (idk how it is called for your compiler) and mine does treat some warnings as errors too like:
deltaScroll = -menuList.size()+itemsVisible;
Which gives me error C4146 for example.
FYI , g++ has no concept of warning/error levels but you can turn on and off many different warnings (like passing -Wfoo).

Besides , is the executable statically linked ?i doubt it, as the size is very small . If it isn't please also provide the necessary dlls.
I am unable to run under wine in linux as it requires the vc++ 2013 redist. library.