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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - amhndu

Pages: [1]
1
So I made a simple flight simulator to learn OpenGL which uses SFML for context creation, input/events as well as loading images.

Update: See this

Screenshots:
(click to show/hide)

Source on GitHub: https://github.com/amhndu/fly/

The plane can be controlled with WASD or the arrow keys. The interface is also quite simple with only some command line arguments.

Here's a video of it in action!

2
SFML projects / TwoCars - A simple endless survival game
« on: February 22, 2017, 01:35:33 pm »
TwoCars

A clone of the 2 Cars game in C++14/SFML TwoCars is a simple 2D endless runner where you simultaneously control two cars while taking all the circles and avoiding all triangles to keep running.

Screenshots





Github
https://github.com/amhndu/TwoCars

YouTube

3
General / Can't compile SFML for Android on Linux
« on: February 10, 2017, 01:22:49 pm »
Trying to follow this tutorial: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android

I've installed Android Studio with Android SDK (the latest stable), then from the SDK Manager, installed the NDK (version 13).
I've accordingly set my PATH to include the android sdk/tools, sdk/platform-tools and the ndk it had downloaded and set ANDROID_NDK accordingly too.

Then executing the cmake command on the wiki gives me this error:
(click to show/hide)

I've tried this both with SFML 2.3.2 and SFML github snapshot.

My system: Ubuntu 16.04

I even found a forum post with someone having similar problem (http://en.sfml-dev.org/forums/index.php?topic=16033.0) but OP's case was solved when they switched to NDK 10 from 9 but I'm using 13, a much newer version.

4
SFML projects / SimpleNES -- An NES emulator in SFML and C++!
« on: December 08, 2016, 12:57:00 pm »
SimpleNES

Github repo
An NES emulator written in C++ and SFML.
Roughly 40-50% of games should work (ie. games that use either no mapper or mappers 1, 2 or 3).
Examples of games that have been tested to run (but NOT limited to):
(USA/Japan or World versions only i.e. NTSC compatible)
  • Super Mario Bros.             
  • Contra                         
  • Adventure Island               
  • Ninja Gaiden                   
  • Wrecking Crew                 
  • Megaman and Megaman 2         
  • Mario Bros.                   
  • Donky Kong and Donkey Kong Jr.
  • Battle City                   
  • Paperboy                       
  • Legend of Zelda               
  • Pacman                         
  • Tennis                         
  • Excitebike                     
Here's a big list of games that match the supported specs from SimpleNES. (Unlike the list above, these aren't tested. Some may or may not work)

Screenshots

(click to show/hide)

Videos

Playlist on YouTube: https://www.youtube.com/playlist?list=PLiULt7qySWt2VbHTkvIt9kYPMPcWt01qN

Download

Windows 32-bit
Linux 64-bit

I don't have a Mac executable but I've tested an older version of the emulator and should work now too.

ROMs available here for testing

Compiling

You need:
* SFML 2.0+ development headers and library
* C++11 compliant compiler
* CMake build system

Compiling is straight forward with cmake, just run cmake on the project directory with CMAKE_BUILD_TYPE=Release
and you'll get Makefile or equivalent for your platform, with which you can compile the emulator

For e.g., on Linux/OS X:
$ git clone https://github.com/amhndu/SimpleNES
$ cd SimpleNES
$ mkdir build/ && cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j4    #Replace 4 with however many cores you have to spare


Running

I didn't bother with a GUI, the emulator can be launched from the terminal.
Just pass the path to a .nes image like
$ ./SimpleNES ~/Games/SuperMarioBros.nes
To set size of the window,
$ ./SimpleNES -w 600 ~/Games/Contra.nes
For supported command line options, try
$ ./SimpleNES -h


Keybindings can be configured with keybindings.conf

Default keybindings:

Player 1

 Button        | Mapped to
 --------------|-------------
 Start         | Return/Enter
 Select        | Right Shift
 A             | J
 B             | K
 Up            | W
 Down          | S
 Left          | A
 Right         | D

 
Player 2

 Button        | Mapped to
 --------------|-------------
 Start         | Numpad9
 Select        | Numpad8
 A             | Numpad5
 B             | Numpad6
 Up            | Up
 Down          | Down
 Left          | Left
 Right         | Right

5
SFML projects / A simple musical Notes player
« on: July 01, 2016, 10:08:18 am »
Notes
Notes is a simple graphical musical notes player. Within the window use the keyboard to play. The numeric row and alphabetical rows are used.Using each row is equivalent, thus 1, Q, A and Z all play the same note. The notes get higher from left to right

Github link
https://github.com/amhndu/Notes

Command line options:

Usage ./notes [OPTIONS]
--help, -h                        Display this text and exit
--note-duration, -d <duration>    Set the note duration in milliseconds
                                  (default: 300)
--sample-rate, -r <rate>          Set the sample in samples per second, higher
                                  means higher quality but also higher load time
                                  (default: 441000)
--namednotesinput, -n             Input/play notes by their names instead.
                                  Available notes: C D E F G A B
                                  Don't use this option if you want more notes
                                  or the positional input (the default)

Compiling
Dependencies

SFML 2+
Build system: cmake 3.1+

On Linux/OS X:

cd Notes                        #Go the the project directory
mkdir build/ && cd build/
cmake -DCMAKE_BUILD_TYPE=Release .. && make
./notes                         #Launch
Similar steps for Windows.

Songs
Try these tunes!

Twinkle Twinkle
 
QQTTYYT RREEWWQ TTRREEW TTRREEW QQTTYYT RREEWWQ

Happy Birthday
 
1-1-2-1-4-3- -1-1-2-1-5-4- -1-1-8-6-4-3-2- -8-8-7-4-5-4

Harry Potter theme
 
E-Y-I-U-Y-P-O-U-Y-I-U-Y-U-E

Mary had a little lamb
In named input method, launch with -n (./notes -n)
 
EDCDEEE DDDEEE EDCDEEE EDDEDC

6
Compiling the library with SHARED=TRUE/FALSE works and the examples compile/run when built with SHARED=FALSE but when linked dynamically, the following error comes up:

Code: [Select]
/usr/bin/ld: opengl: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a(cpuinfo.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
examples/opengl/CMakeFiles/opengl.dir/build.make:111: recipe for target 'examples/opengl/opengl' failed
make[2]: *** [examples/opengl/opengl] Error 1
CMakeFiles/Makefile2:494: recipe for target 'examples/opengl/CMakeFiles/opengl.dir/all' failed
make[1]: *** [examples/opengl/CMakeFiles/opengl.dir/all] Error 2

This is pretty much the same error that comes up when linking any other SFML project.

g++ version: 5.3.1 (5.3.1-14ubuntu2)

7
I had way too much troubles compiling SFML on Ubuntu 12.04, thought I'd write how to do it so someone else hopefully won't have to waste as much time.

First, the packages, apart from the packages listed on the tutorial , I had to install the XCB packages.
Code: [Select]
sudo apt-get install libxcb1-dev libx11-xcb-dev libxcb-icccm4-dev libxcb-image0 libxcb-randr0-dev libxcb-util0-dev

And then as it comes out the xcb_icccm (/usr/include/xcb/xcb_icccm.h) header , has a function prototype using a variable name "class" ...
I had to manually edit it and rename "class" to "_class". (I don't why the error happened, it did have a preprocessor directive to declare "extern C" if __cplusplus was defined , to fix it I tried #define __cpluscplus in Unix/WindowX11impl but it produced tons of more errors  :P)

And then finally , I could compile . (But [on my system at least] , there was no libGLEW.so , i manually had to make a symlink to libGLEW.so.1.5).

Oh and of course , installing the compiled SFML libraries don't work because of the outdated packages in the Ubuntu repository for 12.04

8
SFML projects / Gravity - A Space survival game
« on: November 17, 2014, 01:56:16 pm »
I made a game for my school project using SFML , thought I'd share it here :)
The GitHub repository : https://github.com/amhndu/gravity
The objective is to survive as long as you can in your spaaaaaace station avoiding other satellites and junk. This is a clone of the HTML5 game Orbital Debris.

So, what's your best score ? Mine is about 40s :)
Screenshots








Youtube video


9
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


So try and what do you think ?  :D

Pages: [1]