ndeakin / ski Goto Github PK
View Code? Open in Web Editor NEWAn arcade skiing game made in C++ with the SFML media library
An arcade skiing game made in C++ with the SFML media library
Currently only two sprites are supported for the Skier class. There are a great deal more available, and I think specifically the "carving" set will look best to start (if you aren't sure which set of sprites I mean, look at their location in the sprite sheet).
Game_object_manager::Update_all() should be called in Game::Game_loop() just below the current line 68 in game.cpp. Game::Do_game_loop() should also be renamed 'Update_game_state' (so as to indicate its purpose) and the current calls to Game_object_manager::Update_all() and g_main_window.display() in Game::Do_game_loop() should be called by a separate function in Game called 'Render'.
In addition to fixing the implementation to behave as intended, these changes should make the implementation easier to understand.
The elapsed_time passed to Skier ::Update is never used to calculate the distance moved. Making a change such that elapsed_time is used should fix the "2 modes of speed" behavior that has been observed during gameplay.
There are several other sprite sets available on the sprite sheet. One that would be really awesome to use first would be the tucking set I think, since then I could make the down arrow give the skier an increase in acceleration at the expense of turn ability or something like that, and that would make him appear in the tucking sprites!
Additionally, there is a set that appears similar to the CARVE one, but more aggressive. It would be cool to make it so that the skier appears in that more aggressive stance when he's going above a certain speed perhaps.
Other sets include those for the gates, pushing, falling, and at the end of the race. In time, I want to implement all of the ones that I would like to have game features for.
It looks bizarre for the skier to be slowing down while going straight, it would be a good touch to have him turn something like 60-90 degrees uphill whenever slowing down with the up arrow key. This way the Skier will look as if they are preforming an actual stop.
Currently skiers can move in a circle pretty much forever. This obviously isn't how skiing usually works in real life, so I want to try to make it a little more realistic.
I think friction in general still needs to be added, so I think that's the main point here. However, testing will need to be done to try and get a realistic-ish feel for the ratio of the two.
In skier.cpp, friction has been implemented for when a player uses the up arrow key to slow down. However, the adjustment of the x velocity (on line 47) is not in the correct place: currently the friction is only applied when y velocity is zero.
Its a simple fix for the issue: the adjustment of the x velocity that acts as the friction implementation just needs to be moved outside of the if statement that tests if y velocity is below zero.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.