Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: sfml framework
 Post Posted: June 10th, 2017, 6:30 am 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
Hi there,
worked a bit on the next chapters of the book, which transform the snake game into a classic sidescroller like mario. It took me some time to understand most stuff used in those, but i made it running, after fixing some bugs(you can see some in the commit history).

New features implemented:
+ game map class
- using a map <idMap, pointer<tile>> //the actual map with a reference to the tile the id is holding
- using a set <idSet, pointer<tileInfo>> //set of all possible tiles/segments of a map

- the 1d idMap is converted into 2d (x,y) coordinates
- the gamemap is loaded from file and provides a warp tile to get into the next gamemap
- there are deadly tiles as well - if entities collide with them they die

+ entity manager (with entity base -> character -> player|enemy)
- handles entity construction, destruction and collisions (with gamemap and between entities)
- player and enemies have hp and can kill each other with a little knockback animation for succesfull hits

I not deviated much from the way the author solved the problems to create a 2d sidescroller so far.

It looks the like:
Image

Now iam wondering what to do next. I could goon with the next chapters, modify the sidescroller to another game to consolidate the new learned stuff and to prove if im not only monkey see monkey do like copied the stuff or i could start to create a new project in the chili framework reinventing the whole stuff i made about with a minumum of peeking in the book.

The next chapters are about transforming the sidescroller in a classic 2d roleplay game with orthographic projection using the entity–component–system pattern.
https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system
http://gameprogrammingpatterns.com/component.html

What do u guys recommend?


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 10th, 2017, 6:52 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3234
Location: Japan
xu2201g wrote:
modify the sidescroller to another game to consolidate the new learned stuff and to prove if im not only monkey see monkey do like copied the stuff


I vote for this. Later on after some more experience you can try the isometric game with ECS. It sounds like a fun project, but would likely also be rather monumental and there is a not insignificant chance of giving up midway through.

The screenshot of the platformer looks good man.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 10th, 2017, 10:31 am 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
Allright,
ill give it a shot and iam already thinking of some kind of spaceshooter. Those sprites used re mostly from opengameart.org btw. I dont ve much experience in designing game art.


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 10th, 2017, 12:24 pm 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
I guess its a bit inconvenient to get the projects running from github so ive packed those .exe, .dlls and asset files together to make it a bit easier to test them.


Attachments:
File comment: Snake - removed some stuff i forget about like unnecessary .dlls
snake.rar [904.4 KiB]
Downloaded 6 times
File comment: Spaceshooter
spaceshooter.rar [1.03 MiB]
Downloaded 8 times
File comment: Platformer
platformer.rar [1.03 MiB]
Downloaded 9 times
Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 10th, 2017, 8:24 pm 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
I made some adjustments to the sidescroller and now it looks like that:
Image

There is only one enemy type atm and only one projectile type, but ill implement more soon.
Creating the gamemap only from file is a pain in the arse, thatswhy it is very sparse. I guess it would make sense to make some kind of editor for that.

The viewspace is scrolling on itself horizontally and centers vertically the playership. Hits by rockets oneshot atm. and there is entity to entity collision which reduces the hp by 1 so far.
Entity to gamemap collision does no dmg atm.
There is much to do to make this a real game, but i think its some kind of good start.

Ill attach it and if u want to disable the automatic scrolling just set SCROLLPIXELPERSECOND to 0 in the map1.map in the assets folder.

I made the sprites with paint this time hope you dont get aids from watching them.

Feel free to give me some feedback.


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 14th, 2017, 5:47 pm 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
Well, totally forgot to attach the demo in the last post...
I added a new firemode for the player and u can toggle it by pressing 'q'. (it ll be toggled by powerups later) Firing rockets is bound to 'f'. U can look up the key bindings in the controls.txt or in the key.cfg file which uses sfml keycodes. I have not much time this week, but ill try to improve the game at the weekend. I lack a bit creativity, so if u ve some ideas what would improve the content dont hesitate to tell me.


Attachments:
spaceshooter.rar [957.46 KiB]
Downloaded 5 times
Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 17th, 2017, 7:21 pm 
User avatar

Joined: February 14th, 2017, 7:32 pm
Posts: 95
Quote:
I made some adjustments


It looks like a completely new game to me, this looks really cool!


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 18th, 2017, 12:17 am 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
Thanks, that was my intention :)
To learn more about ways to build a solid framework, which can transform into different kinds of games with not too much effort. I ve added powerups now, which re dropped by destroyed enemy entities and improve the firemode, like u could do by yourself pressing q. I guess the next thing is to create some kind of map editor to make some maps. After that i ll goon with the next chapters about Entity Component Systems.


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 18th, 2017, 5:05 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3234
Location: Japan
I just checked these games out. Looks pretty cool! Platformer jumping physics looks decent. That's usually a hard part to get down.

It seems you have the collision logic in EntityBase, but in an ECS system you'd probably end up having that as part of a component.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post subject: Re: sfml framework
 Post Posted: June 19th, 2017, 1:45 am 
 

Joined: April 19th, 2017, 12:49 pm
Posts: 26
Location: Germany
Added some kind of simple editor as a new state. You can select it in the main menu and even toggle between the game and the editor. The functionality is pretty simple. You select a tile of the game map and a tile of the tile set with the mouse (leftclick) and with space the tile ll be placed.

I want to implement at least also.

- new/save/load
- placing/removing entities (enemies, powerups etc.)
- overwriting already placed/existing tiles

The best way to manage attachments is to place the latest version of the game at the first page of the thread or what do you say?

Thanks for the response, i dont use ECS yet. I want to play around with the codebase to understand it better before i go on with the next chapters, covering ecs, gui, sound and networking.


Attachments:
File comment: editor added
spaceshooter.rar [963.66 KiB]
Downloaded 5 times
Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: