Comments (16)
@niccokunzmann
I can give a try.
from flappy-svg.
@SilentFlame Sure, you are welcome. You do not have to do everything at once. You can split it up into several pull-requests.
from flappy-svg.
i am interested in working on this. I have a doubt . In order to add this we need to change some part of code in otherfiles as well right. like loading backgrounds and stuff
from flappy-svg.
Yes. It is a refactoring that touches a lot. We will gain in the long run. You can start it by creating the object with the interface mentioned above. The methods can be filled step by step and it does not need to be you who does everything.
Some reading to the why: https://en.wikipedia.org/wiki/Technical_debt
from flappy-svg.
@niccokunzmann These levels corresponds to game levels right ?
Also
Level.show()
Level.start()
Level.stop()
Level.hide()
What does they do?
I assume show and hides shows and hides the obstacles and backgrounds. Am I right? What about the other two ?
from flappy-svg.
In the beginning, we can choose levels: Gotham or desert. Show and hide allow to show these levels. start() and stop() are used for playing them.
from flappy-svg.
Now that I read your code, I know more what I am aiming to.
Currently, the data (not functionality) for a level is spread across these files:
- https://github.com/fossasia/flappy-svg/blob/gh-pages/javascript/start_screen.js#L13
- https://github.com/fossasia/flappy-svg/blob/gh-pages/javascript/start.js#L10
- https://github.com/fossasia/flappy-svg/blob/gh-pages/javascript/background.js#L100
- https://github.com/fossasia/flappy-svg/blob/gh-pages/javascript/flapping.js#L90
If we can put this all together in one file, we can add new levels more easily.
var level_specifications = [
{
"name" : "Desert",
"backgrounds" : [
{
"layer" : "DayAndNight",
"velocity" : -20
},
{
"layer" : "background",
"velocity" : -7
},
{
"layer" : "SunAndMoon",
"velocity" : 1
},
{
"layer" : "sky",
"velocity" : ???
}
],
"obstacles" : [
{
"layer" : "cactus",
"velocity" : -7
}
]
},
{
"name" : Gotham",
"backgrounds" : [
{
"layer" : "Gotham",
"velocity" : -7
}
],
"obstacles" : [
{
"layer" : "Gotham_obstacles",
"velocity" : -7
}
]
}
]
character_specifications = [
"bird", // we can add more parameters like gravity and flap speed
"bat",
"alien",
"flappydino",
"helicopter"
]
from flappy-svg.
In future, if it is possible to add a new background to the svg file and then edit this specification and that is all, this is a huge relief and gives us a lot of freedom in the functionality.
It would also make it easier to split up the svg file into several smaller svg files without touching this specification.
from flappy-svg.
@niccokunzmann I made a change to the level specification thing to make it look some what clear. Please Have a look and comment on the status.
from flappy-svg.
@harry-7 I commented. I hope my absence does not discourage you. I was working on this: https://www.youtube.com/watch?v=38JN2JdNnMY&feature=youtu.be
from flappy-svg.
@niccokunzmann Yeah never mind. The video was cool :). Even though I did not understand it completely. It was cool.
from flappy-svg.
@niccokunzmann In the above checklist I think we need to couple of changes.
- getAllLevels()
This is not needed anymore .
And except level.start() and level.stop() all the remaining are implemented may be you can check them. What do you say ?
from flappy-svg.
I will check them as soon as they are used in the program and replaced the old functionality. This is as soon as the functionality is not in these files any more.
from flappy-svg.
hey @niccokunzmann . Can I take this up ? Or is the GCI thing still going on ?
from flappy-svg.
@harry-7 sure you can take this up, regardless of GCI going on or not.
from flappy-svg.
@niccokunzmann what is the idea behind level.start() and level.stop() methods? as in what work needs to be done by them?
from flappy-svg.
Related Issues (20)
- Create automatic build for Windows app HOT 2
- Keyboard Control HOT 4
- Travis is failing
- Refactor the credits page with jekyll HOT 3
- Remove a character's onclick function HOT 6
- Add loading animation HOT 3
- First Android app: loading of game takes a long time HOT 1
- Add travis build badge
- Make build fail when APK did not compile HOT 2
- Merge apps
- Why does this game has pathetic graphics HOT 3
- Game Over without touching any object? HOT 4
- Help page doesn't open in chrome browser HOT 1
- How to Play Link leads to Blank Page in Chrome!
- [ci] Build failure because of broken Play Store link
- No Sound in the github pages version of the app
- Typos in the hints readme file
- Not ending game when touching object HOT 2
- Error message HOT 9
- Bugs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flappy-svg.