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.


Messages - amhndu

Pages: [1] 2 3
1
Update:

I've added collision detection and and a particle system for explosions!
Other than that, smoother controls, fixes and now the camera can be rotated/zoomed with the mouse.

Short video demonstrating collision: https://gfycat.com/gifs/detail/CharmingFastCoqui
And a longer video with the improved controls:

2
I don't really have any plans to make this into anything bigger except I could some novelty things like explosions and stuff in the future. This was just a little experiment in 3D graphics.

3
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!

4
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

5
General / Re: Can't compile SFML for Android on Linux
« on: February 12, 2017, 10:44:54 am »
Thanks!
I was able to compile and run the example app.

Is this only a problem with Linux systems ?
Otherwise why isn't stlport_shared the default ?

6
General / Re: Can't compile SFML for Android on Linux
« on: February 12, 2017, 10:17:03 am »
Now I'm getting linker errors when trying to compile the example.
It is this same issue: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android#stl-clash
But the resolution provided is to use: "-DANDROID_STL=c++_shared" but if I do that, SFML doesn't compile at all.

(click to show/hide)

7
General / Re: Can't compile SFML for Android on Linux
« on: February 12, 2017, 10:09:20 am »
Thanks!
It worked!!

I've added that to SFML wiki.

8
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.

10
SFML projects / Re: SimpleNES -- An NES emulator in SFML and C++!
« on: December 12, 2016, 08:20:26 am »
And yeah, I remember your mail. What went wrong with ImGui?

It can't be customised much, I couldn't even change the font...
I found it to be too big to include in my project and I think it's meant more for debugging and development than a user-facing GUI.
All I wanted was a simple laucher, I gave up on the GUI as I found the command line invokation good enough

11
SFML projects / Re: SimpleNES -- An NES emulator in SFML and C++!
« on: December 09, 2016, 10:38:34 am »
Very impressive, great job! Can you tell us a bit more about it? Maybe there was something interesting in implementation or some C++11 things that greatly helped you?
I've never done emulation, so this topic is pure magic for me. :D

I haven't particularly used much of modern C++ or any cool new features except for lambdas,
range-based for loops, std::chrono and other minor things.

Talking about the development, NES is fairly well documented.
The cpu 6502 was used in Apple I and II, several systems by Commodore and Atari,
so it has tons of documentation online.
Emulating a CPU involves reading the instructions made up of opcodes, specifying the operation and the operand.
These operate on the few registers 6502 has and the small 8-bit address space of which large portions are unmapped and
mirrored in the NES which consists of only 32KB for the read-only instructions and 2KB of RAM! (Aren't we privileged with gigabytes of memory to waste ?)
The CPU was then the easiest part of the development.
The NES sports a PPU, a Picture Processing Unit, the predecessor of the beasts we have as GPUs these days :)
The PPU too has only 2KB of (V)RAM plus 2KB for "name-tables" plus some bytes for the palette.
The resolution of the picture produced by the NES is 256x240 which is 61KB (with a color depth of 1 byte) is way more than the space we have.
So the picture is made up with the help of repeating patterns which you've obviously observed playing a game on it.
The background is thus made with patterns defined in the "pattern table", the screen is made of these patterns as arranged in the "name-tables".
It actually has address for four name-tables but space only for two, so two of these are mirrored.
The PPU thus offers scrolling between these name-tables which helped spawn all the platformers on the NES.
Making this PPU involved LOTS of bit-manipulations. I once spent days tracking down a bug which came out to be ONE wrong BIT!
Anyway it was quite fun and I had it easy as most of reverse-engineering has already been done for the NES.

Edit: Oh and I gave up on trying to make a GUI with ImGui, remember my mail on fonts ? :D

12
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

13
SFML projects / Re: A simple musical Notes player
« on: July 02, 2016, 06:07:44 am »
@Mario
Thanks, I forgot about the headers!
I installed SFML under /usr/ so I didn't need to mention the header location for my system


Good to see people actually interested in musical things with SFML  :D

I once made a virtual keyboard too (I use it in a music editor that I'm casually working on). I would suggest that you also include sharp/flat notes. I mean, they're needed for that Harry Potter theme! :P

The keyboard is layed out rather nicely to place them on alternate rows. For example:
23 567 90 = (C# D# F# G# A# C# D# F#)
QWERTYUIOP[] (CDEFGABCDEFG)
SD GHJ L; (C# D# F# G# A# C# D#)
ZXCVBNM,./ (CDEFGABCDE)


Good idea, I'll probably implement them too

14
SFML projects / Re: A simple musical Notes player
« on: July 01, 2016, 01:27:14 pm »
On what platform are you suggesting ? I can only make binaries for Linux, should I make it static ?
As my thinking goes, different distributions might be incompatible.
For other platforms, I'll probably ask a friend with Mac and another with Windows for help.

15
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

Pages: [1] 2 3
anything