SFML community forums

General => SFML projects => Topic started by: tkir on January 13, 2016, 03:57:23 pm

Title: First game
Post by: tkir on January 13, 2016, 03:57:23 pm
Hi all!
it's my first game. About a month with SFML, about 7 month of studying programming from zero.
http://youtu.be/1AtpjUm5w5I

Code: https://github.com/tkir/tkir_Game (https://github.com/tkir/tkir_Game)

Now I tring to convert game in isometric map.
I checked collisions, but can't make pathfinder.
Is anybody made something like:
struct entityObject{
        Vector2f point[4];
};

std::vector<Vector2f> pathfinder (entityObject player,
    std::vector<entityObject> obstacles,
    Vector2f targetPosition)
{
        std::vector<Vector2f> path
        /* ... */

        return path;
}

std::vector<Vector2f> path = pathfinder(player, obstaclesVector, targetPos);
 
(http://i63.tinypic.com/o882ft.png)

map contains from the float pixels, player is not a point (it have sizes)

Is somebody solved this pathfinder already?
Title: Re: First game
Post by: SpeCter on January 13, 2016, 04:04:10 pm
Your pathfinder should not be dependend on your visual representation of the map.

Example here:
http://simblob.blogspot.de/2014/07/pathfinding-on-isometric-grids.html
Title: Re: First game
Post by: tkir on January 25, 2016, 08:20:10 pm
Hi!
Next step is pathfinder. It work with isometric map. Smoothing is workin too!
[video]https://youtu.be/zS8hRD04FHg[/video] /*how to add video??*/

github: https://github.com/tkir/goldenbyte2016

http://www.youtube.com/watch?v=zS8hRD04FHg
Title: Re: First game
Post by: Mortal on January 25, 2016, 09:38:46 pm
it looks better. i was wondering, are you going to make it as game or just a practice in tile-base games?

btw, to show video  just copy and paste the link from browser search bar without s in http://www.youtube.com/watch?v=#####
Title: Re: First game
Post by: tkir on January 25, 2016, 10:04:53 pm
It's my first experience in game coding, & it's best practice in C++.

May be for a month Pathfinder & parser for isometric map will transform into library.
Is it expedient for other SFML users?
Title: Re: First game
Post by: Mortal on January 25, 2016, 11:09:34 pm
i haven't done any tile-based game yet. but you made pretty good, i have learned from it alot  :)
Title: Re: First game
Post by: zsbzsb on January 26, 2016, 01:19:30 pm
May be for a month Pathfinder & parser for isometric map will transform into library.
Is it expedient for other SFML users?

You should read this link: Write Games, not Engines (http://geometrian.com/programming/tutorials/write-games-not-engines/). Don't set out and try to write a generic library that anyone can use, instead focus on making a game with your code.
Title: Re: First game
Post by: Hapax on January 27, 2016, 01:39:07 am
At 00:30 in your video, the "enemy" inside the walls in the centre of the map learns how to travel through objects and then, for some reason, prefers to travel backwards.  ;D
Title: Re: First game
Post by: grok on January 27, 2016, 10:13:08 am
I spot tile glitches from time to time. Am I right or it is due to video recording?
Title: Re: First game
Post by: tkir on January 29, 2016, 06:12:11 pm
Yes. It's problem of SFML.
Title: Re: First game
Post by: Hapax on January 31, 2016, 11:51:00 pm
I spot tile glitches from time to time. Am I right or it is due to video recording?
Yes. It's problem of SFML.
This is inaccurate. SFML can reliably draw tiles without glitches if done correctly.