These are chat archives for Azurasky1/DragonArena

13th
Jun 2016
Billy B.
@Azurasky1
Jun 13 2016 07:43
i'll organize my thoughts and get back to you
got some cool ideas
Billy B.
@Azurasky1
Jun 13 2016 13:08
ok, so i just pushed a new document to the develop branch
it details the entire project and its components and prioritizes those components from core functionality to extra stuff to be added later
take a look at it. when you can, i wanna have a discussion about how we should approach doing different things (like showing canvas elements on screens that have different resolutions)
feel free to add in comments wherever you see fit and push them so that i can see your thoughts
i gotta see what we already have so we don't end up repeating ourselves
Andrea Sonny
@andreasonny83
Jun 13 2016 14:03
hey
I had a look at the readme file.
Billy B.
@Azurasky1
Jun 13 2016 14:04
sweet
Andrea Sonny
@andreasonny83
Jun 13 2016 14:04
sounds good but doesn’t explayin any deployment roadmap
Billy B.
@Azurasky1
Jun 13 2016 14:04
i'm not really familiar with any weird corporate methodologies
how does something like that usually look
Andrea Sonny
@andreasonny83
Jun 13 2016 14:05
well, that really depends on the project itself
however, a standard roadmap will see some “stories” to be completed in order to release minor build versions
Billy B.
@Azurasky1
Jun 13 2016 14:06
interesting
so the first story would probably include all of the priority 1 stuff i listed in the document
Andrea Sonny
@andreasonny83
Jun 13 2016 14:06
in GitHub you can create issues and milestones. A good strategy using only GitHub as issue tracker, will be to define at least one milestone and some issues related to that
let say we define an App version 0.0.1 milestone with some issues related in order to have a working 0.0.1 version of the app at the end of that
Billy B.
@Azurasky1
Jun 13 2016 14:08
ok
Andrea Sonny
@andreasonny83
Jun 13 2016 14:08
for the first version, we need to make sure we include all the essential functionalities and view for the app to work at the end of the milestone completition
so we can have a v0.0.1 release at the end of it
Billy B.
@Azurasky1
Jun 13 2016 14:09
how detailed do those issues usually go
Andrea Sonny
@andreasonny83
Jun 13 2016 14:09
then we can define future milestone with more functionalities, bugs etc
Billy B.
@Azurasky1
Jun 13 2016 14:09
right right
i wish we could work on the same thing in real-time
Andrea Sonny
@andreasonny83
Jun 13 2016 14:10
again, the more information you can include in the issue description, the better
Billy B.
@Azurasky1
Jun 13 2016 14:10
that way we could explain our code to one another
yeah
that seems pretty straightforward i could pull something like that together in a few minutes
Andrea Sonny
@andreasonny83
Jun 13 2016 14:10
also, defining issues will let us working in parallel and speed up the process
Billy B.
@Azurasky1
Jun 13 2016 14:10
do you have one branch that encompasses all of your changes
or do you make several branches, one for each part
Andrea Sonny
@andreasonny83
Jun 13 2016 14:11
we need to remember that the server side is hosted on a separate git repository
Billy B.
@Azurasky1
Jun 13 2016 14:11
that's right
Andrea Sonny
@andreasonny83
Jun 13 2016 14:11
maybe we can move the code in this one so we can have everything in the same place
Billy B.
@Azurasky1
Jun 13 2016 14:11
is there any way to merge the two repositories
Andrea Sonny
@andreasonny83
Jun 13 2016 14:11
yes, sure. I can do that
Billy B.
@Azurasky1
Jun 13 2016 14:12
can we put them in my repository?
Andrea Sonny
@andreasonny83
Jun 13 2016 14:12
sure
Billy B.
@Azurasky1
Jun 13 2016 14:12
cool
Andrea Sonny
@andreasonny83
Jun 13 2016 14:12
you can also define new labels for the issues from here: https://github.com/Azurasky1/DragonArena/labels
so, I created this issue linked to the v0.0.1 milestone.
Azurasky1/DragonArena#10
Billy B.
@Azurasky1
Jun 13 2016 14:14
just saw it
so as a general rule of thumb will most of the starting code we put in go under "enhancement"
Andrea Sonny
@andreasonny83
Jun 13 2016 14:14
as I complete this task, you will see in the milestone track, the progressbar moving from 0 to a major value (depending on the number of issues in the same milestone)
yes, I think all the card related to the first release will be tagged as ‘enhancement’ as we don’t have bugs already
Billy B.
@Azurasky1
Jun 13 2016 14:16
ok i'm gonna put in some issues
Billy B.
@Azurasky1
Jun 13 2016 14:29
added a whole bunch
gave them labels too
we can probably use some of the code that we already have, i know you started the collision detection
Billy B.
@Azurasky1
Jun 13 2016 14:40
when you can i would like for you to tell me a little bit about sass and gulp because i noticed that you are using them
Andrea Sonny
@andreasonny83
Jun 13 2016 14:43
ok, I completed my task :)
Billy B.
@Azurasky1
Jun 13 2016 14:43
awesome!!
=)
i'm combing through the code now to see what we can reuse
Andrea Sonny
@andreasonny83
Jun 13 2016 14:44
well sass is just a css preprocessor, is good in order to split the css into different files easy to maintain and read
also, you can define variable and mixins
is really easy to understand and once you get used to it, you will never being able to get rid of it
Gulp is a task runner
essential if you want to build and pack a release
you can define tasks for minifying css and js, compress images and other cool stuff that can simply be run with 1 terminal command instead of manually doing all of those operations
if you’re not using that already, I really recomend you to use Atom as texteditor
it has a lot of free pluging that make your life easier
Billy B.
@Azurasky1
Jun 13 2016 14:49
ok
i've been using notepad++ up until this point
Andrea Sonny
@andreasonny83
Jun 13 2016 14:49
well, I used Notepad++ ages ago, then I switched to SublimeText and last year I migrated to Atom
Billy B.
@Azurasky1
Jun 13 2016 14:51
that little file interface on the side is really nice
Andrea Sonny
@andreasonny83
Jun 13 2016 14:51
I can give you a list of “essentials” plugins to install on Atom when you want
Billy B.
@Azurasky1
Jun 13 2016 14:51
yeah do that
Andrea Sonny
@andreasonny83
Jun 13 2016 14:51
the icons?
what file interface?
Billy B.
@Azurasky1
Jun 13 2016 14:52
on the left side, the collapsable folders that show the different js and css files
lets u navigate the directory
Andrea Sonny
@andreasonny83
Jun 13 2016 14:52
yes, you can navigate thru the project folder
and easily switch between files
Billy B.
@Azurasky1
Jun 13 2016 14:52
that's awesome
Andrea Sonny
@andreasonny83
Jun 13 2016 14:53
it’s kind of essential if you work as a developer
Billy B.
@Azurasky1
Jun 13 2016 14:53
yeah looks useful
i'm really ambitious and definitely want to give myself every edge that i can to make myself more efficient
Andrea Sonny
@andreasonny83
Jun 13 2016 14:53
you can also install plugin to run JavaScript linting as you type the code. extremly useful
Billy B.
@Azurasky1
Jun 13 2016 14:54
ok
now you have me sold
linting too? :D
i'll never have to use jslint ever again... so clunky...
Andrea Sonny
@andreasonny83
Jun 13 2016 14:55
it is actually using jslint but it runs inside your texteditor
Billy B.
@Azurasky1
Jun 13 2016 14:55
hahaha
that is ironic
very cool
Andrea Sonny
@andreasonny83
Jun 13 2016 14:55
Screen Shot 2016-06-13 at 15.54.41.png
Billy B.
@Azurasky1
Jun 13 2016 14:56
what am i looking at
Andrea Sonny
@andreasonny83
Jun 13 2016 14:56
that error is triggered by the JSHint plugin as you can see on the textedit footer: JSHint 11:7 ‘test’ is defined but never used.
but I’m now using JSLint
more powerful and updated
ESlint, sorry
Billy B.
@Azurasky1
Jun 13 2016 14:58
yeah if i'm not mistaken, lints are used to comb for code that goes against the standard coding conventions
and find other bugs
pretty useful stuff
The pluggable linting utility for JavaScript and JSX
Andrea Sonny
@andreasonny83
Jun 13 2016 15:06
yes, that’s correct
Billy B.
@Azurasky1
Jun 13 2016 15:09
only now after taking that course am i noticing your iife's
in your game.js file in your modules folder you are assigning variables to document.body.offsetWidth & offsetHeight
Andrea Sonny
@andreasonny83
Jun 13 2016 15:20
:)
Billy B.
@Azurasky1
Jun 13 2016 15:28
so that adjusts the size of the game screen
Andrea Sonny
@andreasonny83
Jun 13 2016 15:28
yep
Billy B.
@Azurasky1
Jun 13 2016 15:28
do the elements scale with it
Andrea Sonny
@andreasonny83
Jun 13 2016 15:28
nope
Billy B.
@Azurasky1
Jun 13 2016 15:28
how are we gonna do that
Andrea Sonny
@andreasonny83
Jun 13 2016 15:28
that’s just the board size
Billy B.
@Azurasky1
Jun 13 2016 15:29
yeah that's what i thought
Andrea Sonny
@andreasonny83
Jun 13 2016 15:29
do you want zoom in/out buttons?
Billy B.
@Azurasky1
Jun 13 2016 15:31
it's not necessary
Andrea Sonny
@andreasonny83
Jun 13 2016 15:32
so maybe we don’t want to scale at all?
if the user has a bigger screen, he/she will just see a bigger portion of the world
that’s a question for later in any case
Billy B.
@Azurasky1
Jun 13 2016 15:33
it needs to all look the same but if the user has a smaller screen then the elements need to scale down
Andrea Sonny
@andreasonny83
Jun 13 2016 15:33
once we have someting running in our project we can start thinking about stuff like that
Billy B.
@Azurasky1
Jun 13 2016 15:33
ok
Andrea Sonny
@andreasonny83
Jun 13 2016 15:34
if you want all the screen size to look the same, then we can start developing “mobile first” and define a board size of 350px for example
Billy B.
@Azurasky1
Jun 13 2016 15:36
ok, you take the lead on that portion
using pixels just doesn't make sense to me, there has to be some other unit of measurement because not every screen has the same amount of pixels
Andrea Sonny
@andreasonny83
Jun 13 2016 15:37
sure, no problem
well 1 pixel is the same on all the devices
Billy B.
@Azurasky1
Jun 13 2016 15:38
yeah but while a phone might have 350 pixels my monitor has 1920 pixels
Andrea Sonny
@andreasonny83
Jun 13 2016 15:38
that’s the point. we start defining the smallest resolution which is 350px
then we will need to define other rules in case the screen is bigger
Billy B.
@Azurasky1
Jun 13 2016 15:39
you mean define variables for every different resolution??
Andrea Sonny
@andreasonny83
Jun 13 2016 15:39
no no, you can just define a couple of checkpoints
mobile is the default one, then tablet and desktop
so 2 checkpoints in total
Billy B.
@Azurasky1
Jun 13 2016 15:39
is there some property in the document that is = to screen resolution
Andrea Sonny
@andreasonny83
Jun 13 2016 15:40
you can define them in css using media queries
Billy B.
@Azurasky1
Jun 13 2016 15:40
i'm gonna have to see this one myself
it's probably the single biggest question out of everything i wrote in that document
Andrea Sonny
@andreasonny83
Jun 13 2016 15:42
document. scrollWidth in JS
Billy B.
@Azurasky1
Jun 13 2016 15:42
and i'm guessing there is a scrollheight
Andrea Sonny
@andreasonny83
Jun 13 2016 15:42
yep
Billy B.
@Azurasky1
Jun 13 2016 15:45
first time seeing that
Andrea Sonny
@andreasonny83
Jun 13 2016 15:45
oh -_-;
Billy B.
@Azurasky1
Jun 13 2016 15:45
looks like arabic
yeah dude
Andrea Sonny
@andreasonny83
Jun 13 2016 15:45
it’s pretty easy to understand
Billy B.
@Azurasky1
Jun 13 2016 15:45
early college programming courses are shit
Andrea Sonny
@andreasonny83
Jun 13 2016 15:45
@media (max-width: 600px) {
that’s it
all the css rules between those curly braces will be applied only if the page width is smaller that 600px
just try in your browser
Billy B.
@Azurasky1
Jun 13 2016 15:47
wouldn't you need to change the sizes of the elements for every possible screen resolution
instead of checking for a maximum width would you not want to check for a specific width
what good does having a maximum width do
Andrea Sonny
@andreasonny83
Jun 13 2016 15:48
well you will see and understand soon enough
Billy B.
@Azurasky1
Jun 13 2016 15:49
ok ok
Billy B.
@Azurasky1
Jun 13 2016 16:07
hey sonny
Andrea Sonny
@andreasonny83
Jun 13 2016 16:14
Hey
Billy B.
@Azurasky1
Jun 13 2016 16:14
just wondering how long you have been programming?
Andrea Sonny
@andreasonny83
Jun 13 2016 16:14
10 years more or less
Billy B.
@Azurasky1
Jun 13 2016 16:14
you are an inspiration to the people
Andrea Sonny
@andreasonny83
Jun 13 2016 16:15
But I started with c, c++, basic and otber languages
Hmm, no. I really don't think so but tnx :smile:
Billy B.
@Azurasky1
Jun 13 2016 16:16
haha no problem
i've heard of those languages and i figured you had dabbled with them because of how you write
and one of your libraries said something about using c
Andrea Sonny
@andreasonny83
Jun 13 2016 16:17
? Really? Which one
Billy B.
@Azurasky1
Jun 13 2016 16:17
think it was gulp
Andrea Sonny
@andreasonny83
Jun 13 2016 16:18
I used C last time somewhere around 9 years ago. I completely forgot everything about all that stuff
Billy B.
@Azurasky1
Jun 13 2016 16:18
to hell with c
js devs are in extremely high demand everywhere
Andrea Sonny
@andreasonny83
Jun 13 2016 16:19
It's only 6 month since I stopped writing PHP code and I've almost forgot everything about that too
Billy B.
@Azurasky1
Jun 13 2016 16:20
sonny! wtf man
php is starting to be a dead language anyway
no one will miss it
Andrea Sonny
@andreasonny83
Jun 13 2016 16:24
Probably not, that's why I switched to 100% javascript
Nodejs is extremely more powerful than php
We're on the right path for now, but things are charging sooo fast you cannot predict what's going to happen in 6 months from now
So never stop learning is the key
Never sit down and relax, you always have everything to learn every day
That's the good and bad of this field
Billy B.
@Azurasky1
Jun 13 2016 16:27
yep, i think about that all the time...
pretty much all my js knowledge has been stuff i had to teach myself
Andrea Sonny
@andreasonny83
Jun 13 2016 16:27
Still not 100% sure it's a good thing tho
Billy B.
@Azurasky1
Jun 13 2016 16:27
i really want to work for a startup someday
or create my own
Andrea Sonny
@andreasonny83
Jun 13 2016 16:27
Sure, why not
Why startup instead of big companies
Billy B.
@Azurasky1
Jun 13 2016 16:28
technology i feel is where the money is at, especially with so many businesses needing to move to mobile in order to remain competitive
well
while it is great that big companies can provide job security, startups have the potential for huge returns
isn't the dream of this industry to be successful, and then retire early?
Andrea Sonny
@andreasonny83
Jun 13 2016 16:29
Mobile has no future, trust me. I never wasted my time on that
Billy B.
@Azurasky1
Jun 13 2016 16:29
i wouldn't know about that but i'll take your word for it
Andrea Sonny
@andreasonny83
Jun 13 2016 16:29
I'm not sure about the retirement question, but yes
I cannot guarantee that will be the future but I have my good point for that
Billy B.
@Azurasky1
Jun 13 2016 16:30
interested to hear it
Andrea Sonny
@andreasonny83
Jun 13 2016 16:30
I mean, smartphones won't last forever, right?
Billy B.
@Azurasky1
Jun 13 2016 16:31
they will for the foreseeable future
Andrea Sonny
@andreasonny83
Jun 13 2016 16:31
New technologies will replace them
Billy B.
@Azurasky1
Jun 13 2016 16:31
newer technologies will always replace older technologies
Andrea Sonny
@andreasonny83
Jun 13 2016 16:31
Google already had one try with smartglasses
New technologies will use different development languages
But the web is one and cross supported
Billy B.
@Azurasky1
Jun 13 2016 16:32
that's true and i have always been more interested in the web aspect
Andrea Sonny
@andreasonny83
Jun 13 2016 16:32
And there are already good compromises for running websites like native apps
Billy B.
@Azurasky1
Jun 13 2016 16:32
however i feel that since people use their phones for almost everything now, any business is gimping itself by not having a mobile presence
Andrea Sonny
@andreasonny83
Jun 13 2016 16:33
Well native app developer has also a small slice in the job market
Not all the companies produce native apps
And the they need different developer for producing ios, android or windows app
Too complex
You can build one webapp that works on everything
The future key is easy dude, so everything is not easy has not future
But, again, that's just my point of view
Billy B.
@Azurasky1
Jun 13 2016 16:36
i am always interested in hearing your point of view
Andrea Sonny
@andreasonny83
Jun 13 2016 16:36
:smile: thanks again
But trust me, I'm not a guru at all
Billy B.
@Azurasky1
Jun 13 2016 16:37
it's just like you said, the industry is constantly evolving. people will always need to stay updated with current technology, learn the newest programmer languages. it's part of staying competitive
Andrea Sonny
@andreasonny83
Jun 13 2016 16:37
Faaar from that
Billy B.
@Azurasky1
Jun 13 2016 16:37
that is ok
i am not a guru either :P
Andrea Sonny
@andreasonny83
Jun 13 2016 16:39
Well, what I'm saying is: javascript has been evolving for decades and it's geeting bigger and bigger. As you noticed too, is eating all the other web scripts and we're moving to a easier future (one script for everything)
Native app languages like java, objective c, etc are difficult to lear and they are not flexible from an evolutionary point of view
Billy B.
@Azurasky1
Jun 13 2016 16:41
i completely agree
Andrea Sonny
@andreasonny83
Jun 13 2016 16:41
But we will see
I also don't believe in ReactJS and I support AngularJS instead
Billy B.
@Azurasky1
Jun 13 2016 16:44
i haven't had experience with either of those yet so now is your chance to persuade me of your preference
Andrea Sonny
@andreasonny83
Jun 13 2016 16:46
Well no. I can be wrong on that
You will chose by your own
Good to know them both if you have time enough
Billy B.
@Azurasky1
Jun 13 2016 16:47
each library and framework all has extensive documentation
it is so cumbersome having to sift through all of it whenever i am trying to do something new
do you ever get used to that??
and then i have to google the vocabulary that i don't know
Andrea Sonny
@andreasonny83
Jun 13 2016 16:48
Not sure to follow you
But yes, all the different libraries introduce new words and complexity to the logic you're used to
Billy B.
@Azurasky1
Jun 13 2016 16:50
not sure you follow me?
Andrea Sonny
@andreasonny83
Jun 13 2016 16:50
It's frustrating sometimes
Billy B.
@Azurasky1
Jun 13 2016 16:50
so you get what i'm saying
Andrea Sonny
@andreasonny83
Jun 13 2016 16:50
I'm not sure I understood your question property
Billy B.
@Azurasky1
Jun 13 2016 16:51
i am saying, do you ever get accustomed to the process of sifting through a framework's API documentation every time you want to do something with it, that you don't yet know how
because for the official node.js documentation, there are hundreds of different methods, and many modules all for different things, or even multiple ways to do a single thing, and each function has its own parameters, etc. etc.
Andrea Sonny
@andreasonny83
Jun 13 2016 16:52
Righ right
Billy B.
@Azurasky1
Jun 13 2016 16:52
how can one person even possibly memorize all of that
it seems unlikely. if anything, the person will use it as a reference
Andrea Sonny
@andreasonny83
Jun 13 2016 16:53
So yes, the hardest part is starting from scratch. Nobpdy really cover that part enough
Billy B.
@Azurasky1
Jun 13 2016 16:53
that is true. for me, it is hard to figure out where to start... for node.js especially
even my javascript knowledge was still way too bare-bones
Andrea Sonny
@andreasonny83
Jun 13 2016 16:54
You also don't understand why you should learn that new library or framework until you know enough of it
Billy B.
@Azurasky1
Jun 13 2016 16:54
i had to scour the internet for information, guides, tutorials, luckily you referred me to that tony alicea guy, his course was good
right right
Andrea Sonny
@andreasonny83
Jun 13 2016 16:55
That's why I chose angular instead of react. I just started learning angular and learn react will require a lot of time for doing the same thing at the end
Billy B.
@Azurasky1
Jun 13 2016 16:56
right
Andrea Sonny
@andreasonny83
Jun 13 2016 16:56
So, I support angular because it's evolving again, and angular 2 is more a fusion between angular 1 and react
And I prefer google at facebook too
But again, don't trust me. Trust nobody but yourself, but be consistent on your decisions
You can literally change the world if you are firmly convicted
Billy B.
@Azurasky1
Jun 13 2016 17:02
"Trust nobody but yourself, but be consistent on your decisions", that sounds like my decision to use tabs over spaces hahaha :P
i had so many tabs open on various documentations and other things that i ran out of memory and crashed my computer
that last part sonny is why i chose to join this industry
that couldn't be any more true
also what did you mean by prefer google at facebook
Andrea Sonny
@andreasonny83
Jun 13 2016 17:19
I can really help you with the tabs problem. I also have the same issue but I recently discovered a Crome extension for that
that’s super cool
Billy B.
@Azurasky1
Jun 13 2016 17:20
wow
awesome, thanks
i tend to have many tabs open at once so that is a great fir for me
Andrea Sonny
@andreasonny83
Jun 13 2016 17:23
On the Nodejs question, the reason you don't find documentation is because nodejs is nothing but javascript
You just run that on the server side instead of a browser
Billy B.
@Azurasky1
Jun 13 2016 17:24
yeah
that's why i like it, because it's all javascript
Andrea Sonny
@andreasonny83
Jun 13 2016 17:24
So you can only study nodejs libraries like express but there is no Nodejs documentation
Billy B.
@Azurasky1
Jun 13 2016 17:42
i'm trying to create a simple web server
and i want to be able to store the information within a database but i don't know how yet
do you know anything about databases like mongodb
database management
Andrea Sonny
@andreasonny83
Jun 13 2016 17:55
well yes
you should probably use mongodb in nodejs
Billy B.
@Azurasky1
Jun 13 2016 17:55
that's what i was thinking
i'm playing around with it as we speak
Billy B.
@Azurasky1
Jun 13 2016 17:56
yep i'm on that right now
then i started reading up on the "information on documents", then it led me to BSON... then that led me to protocol buffers... :P
Andrea Sonny
@andreasonny83
Jun 13 2016 17:59
hehe
understanding what mongo is
Billy B.
@Azurasky1
Jun 13 2016 18:00
ultimately the database is gonna need to be used to store information on all of the different player objects
and then the server can relay that back to the clients
many times a second
Andrea Sonny
@andreasonny83
Jun 13 2016 18:00
well
Billy B.
@Azurasky1
Jun 13 2016 18:01
or you know, whenever someone changes position
which will end up being many times a second
Andrea Sonny
@andreasonny83
Jun 13 2016 18:01
maybe insteady of writing to the database many times at second, you can just refresh the database information once every second or two to save memory and improve the communitaction speed
you don’t need to read the information from the database all the time
Billy B.
@Azurasky1
Jun 13 2016 18:02
won't you need to, though? at least for the coordinate properties?
Andrea Sonny
@andreasonny83
Jun 13 2016 18:02
the informations are stored in local variables. the database is for backup
Billy B.
@Azurasky1
Jun 13 2016 18:03
the only way for the game to be real-time is if every time a person moves, their coordinates are updated and sent to the server
Andrea Sonny
@andreasonny83
Jun 13 2016 18:03
a typical nodejs server is a cloud server which mean, it starts and stops on demand
when the server is not “serving” any client, it goes off and you need a database for storing all the informations
while the server is running you don’t need a database because you can use faster local variables instead
Billy B.
@Azurasky1
Jun 13 2016 18:04
interesting
i don't get it though
Andrea Sonny
@andreasonny83
Jun 13 2016 18:04
eh
ok
Billy B.
@Azurasky1
Jun 13 2016 18:05
the server is accessing the database? or has its own variables or what? it doesn't necessarily need to save everyone's position in a database, it just has to consistently update the client
there are some things that do need to be in the database all the time, though
Andrea Sonny
@andreasonny83
Jun 13 2016 18:06
let say that a server can goes offline or, because is running a javascript code, it can also crash or exit because of javascript errors
ok?
Billy B.
@Azurasky1
Jun 13 2016 18:06
ok
Andrea Sonny
@andreasonny83
Jun 13 2016 18:06
when the server goes offline, a server script will try to start it back
that can only be a fraction of second sometime
but, if you store all the information inside variables, as the server goes offline, you lose all your information
that’s why you need a database
but, on an ideal scenario, your server is always online and never crashes, right?
so, if you store all the players positions inside variable, it will perfectly work, right?
Billy B.
@Azurasky1
Jun 13 2016 18:09
yeeeeeeeeah if the server doesn't crash
but what's the catch
Andrea Sonny
@andreasonny83
Jun 13 2016 18:09
ok, so you need a database just as backup?
do you agree?
Billy B.
@Azurasky1
Jun 13 2016 18:09
yeah
i can see that, yes
you should explain it in terms of how it applies to our situation
in our situation, the data we are backing up pertains to player characteristics
like health, stats, and coordinates
Andrea Sonny
@andreasonny83
Jun 13 2016 18:11
yes, so more or less you will have a big object where storing all of those informations, like...
Billy B.
@Azurasky1
Jun 13 2016 18:12
an object with no name { "objectkey" : "objectvalue }
Andrea Sonny
@andreasonny83
Jun 13 2016 18:13
var players = [{
  name: 'player1’,
  health: 100,
  position: {
    x: 100,
    y: 205
  }
}, {
  name: 'player2’,
  health: 50,
  position: {
    x: 40,
    y: 10
  }
}];
Billy B.
@Azurasky1
Jun 13 2016 18:13
wow that is some beautiful code
Andrea Sonny
@andreasonny83
Jun 13 2016 18:13
as the users interact with the game, your server will simply update those key/value pairs inside the players object
Billy B.
@Azurasky1
Jun 13 2016 18:14
right right, as i predicted, go on
Andrea Sonny
@andreasonny83
Jun 13 2016 18:14
so, no need for a Db so far, right?
but we want to store that object inside a database
Billy B.
@Azurasky1
Jun 13 2016 18:15
there's a way to make that easy right... as in, change an object into json format and vice versa
we store it so in the event that something happens we don't get fucked right
Andrea Sonny
@andreasonny83
Jun 13 2016 18:15
so, all you need to do is set a timer that every let’s say: 2 seconds, is going to store that object inside a db
but, what’s the point of continously writing to the database without reading those informations?
Billy B.
@Azurasky1
Jun 13 2016 18:16
right, but the server itself will be interacting constantly with the client. if the server fails though then we are only down for a couple of seconds
Andrea Sonny
@andreasonny83
Jun 13 2016 18:17
well, in case our players object became suddenly an empty object, we want to restore that from the database
Billy B.
@Azurasky1
Jun 13 2016 18:17
yep
Andrea Sonny
@andreasonny83
Jun 13 2016 18:17
that’s a basic use of a database
of course, because we’re sending javascript information, player can cheat as well
Billy B.
@Azurasky1
Jun 13 2016 18:18
right in that situation we only lose two seconds worth of information
oh go on
Andrea Sonny
@andreasonny83
Jun 13 2016 18:18
and rewrite their javascript variables
so they can send fake information to the server
so we can run some sanity check on the data the user send back with the ones present in the database to verify they are correct before saving then into the variable
Billy B.
@Azurasky1
Jun 13 2016 18:19
that is smart
if you hadn't said that, i probably would not have thought of it until someone decided to cheat
Andrea Sonny
@andreasonny83
Jun 13 2016 18:19
that’s another reason for having a database
then you would probably need a database for performing players login as well
so players can have their own accounts and save their progress
these are all reasons for having a database
but you don’t need a database for storing a player position, you can just save them inside javascript variables
so we can start without database and, as the app get bigger we’ll implement a db in future versions of the app
I recomend we stay focus on the “essentials" for the app to run at the moment
then we add more complexity
Billy B.
@Azurasky1
Jun 13 2016 18:23
yeah, you're right
Andrea Sonny
@andreasonny83
Jun 13 2016 18:24
basic animations, basic server interactions and basic functionalities. As we cover all the client app functionalities, we can start with a cool user interface, a multiplayer solution and a strong server side
Billy B.
@Azurasky1
Jun 13 2016 18:24
most of this other stuff though is peanuts compared to this, i think the most exciting part of this will be maintaining the server, scaling it so that it doesn't mess up under load
but yes, that will mean toughing it through the arduous animation logic and canvas stuff
Andrea Sonny
@andreasonny83
Jun 13 2016 18:25
the server side will be probaly challenging yes, but also the rendering engine will be full of surprises I guess
Billy B.
@Azurasky1
Jun 13 2016 18:26
i wonder how fast we can realistically get a stable build
i could finish a lot of our milestone in just a few hours i believe
i think the week that you gave is very generous
Andrea Sonny
@andreasonny83
Jun 13 2016 18:27
probably, but as soon as we complete the first milestone we will probably need to refactor the entire code
make it slimmer
organizing the correct elements in the correct files etc
Billy B.
@Azurasky1
Jun 13 2016 18:27
as in, remove all unnecessary logic and anything on the execution stack that isn't necessary?
Andrea Sonny
@andreasonny83
Jun 13 2016 18:27
probably we will need to re-start the project from scratch and defining a “stable” file structure
right
Billy B.
@Azurasky1
Jun 13 2016 18:28
sounds like a blast
lol
which parts do you plan on getting to first
that way we don't intersect
Andrea Sonny
@andreasonny83
Jun 13 2016 18:31
no idea yet
Billy B.
@Azurasky1
Jun 13 2016 18:31
i'm going to try cleaning up your animation script
right now, the guy moves, but stays in the same spot on the canvas
Andrea Sonny
@andreasonny83
Jun 13 2016 18:32
but you can just assign the issue to yourself as you’re working on them so we don’t work on the same one
Billy B.
@Azurasky1
Jun 13 2016 18:32
can i?
that is very helpful
is it typical to have multiple developers assigned to one issue?
corporate issues are typically much more broad i would imagine and thus require more man-power, as opposed to our very focused, individually small issues
Andrea Sonny
@andreasonny83
Jun 13 2016 18:36
well no, usually developers work on different issues
if the issue is big, is called story so it become an issues “container”
so don’t work on the same issue
you assign an issue to itself and you work on that until is done
I will do the same with another issue
Billy B.
@Azurasky1
Jun 13 2016 18:38
right right, a story. ok
i took the liberty of assigning you to that resolution-scaling issue
Andrea Sonny
@andreasonny83
Jun 13 2016 18:38
there are no stories in github, just issues but it’s the same
Billy B.
@Azurasky1
Jun 13 2016 18:38
feel free to pick any other one that interests you
Andrea Sonny
@andreasonny83
Jun 13 2016 18:38
sure
Billy B.
@Azurasky1
Jun 13 2016 18:38
in the mean time i'll get the free ones one-by-one
Andrea Sonny
@andreasonny83
Jun 13 2016 18:41
are you using the gulp watch task?
Billy B.
@Azurasky1
Jun 13 2016 18:41
no
i don't know anything about gulp yet really
Andrea Sonny
@andreasonny83
Jun 13 2016 18:42
you don’t need to
it’s all written in the readme
just run npm install
then gulp watch
you only need to know Gulp if you want to write the configuration file for the task runner
but you can simply use the one I already created
otherwise you cannot see the SASS generated files without
Billy B.
@Azurasky1
Jun 13 2016 18:45
how come i get an area
error
The term 'gulp' is not recognized as the name of a cmdlet, function, script file, or operable pr
lling of the name, or if a path was included, verify that the path is correct and try again.
Andrea Sonny
@andreasonny83
Jun 13 2016 18:45
what kind of error
Billy B.
@Azurasky1
Jun 13 2016 18:45
i installed it
Andrea Sonny
@andreasonny83
Jun 13 2016 18:45
you need to install that globally
npm i -g gulp
sorry, npm install --global gulp-cli
Billy B.
@Azurasky1
Jun 13 2016 18:46
the first one worked
and it immediately opened a tab
Andrea Sonny
@andreasonny83
Jun 13 2016 18:46
hm
run the other as well
Billy B.
@Azurasky1
Jun 13 2016 18:48
the second one actually gave me an error
well, it ran, but when it launched i got an error
Andrea Sonny
@andreasonny83
Jun 13 2016 18:48
does gulp watch work now?
Billy B.
@Azurasky1
Jun 13 2016 18:49
it looks the same as before yeah
in the shell
Andrea Sonny
@andreasonny83
Jun 13 2016 18:49
what do you mean? is the browser opening a new tab with the app as you type gulp serve?
Billy B.
@Azurasky1
Jun 13 2016 18:50
well i typed gulp watch
initially, gulp watch launched a tab in my browser that showed the animation, with a server status: offline, and then the store
the second time around, i launched it, and it shows me the words cannot get \
cannot get /
and if i type gulp serve in the shell, then i just get the error Task 'serve' is not in your gulpfile
Andrea Sonny
@andreasonny83
Jun 13 2016 18:51
are you inside your project folder?
on the terminal I mean
Billy B.
@Azurasky1
Jun 13 2016 18:52
i think i might need to pull your changes
Andrea Sonny
@andreasonny83
Jun 13 2016 18:52
pull the latest develop branch
then npm install again
then gulp watch
Billy B.
@Azurasky1
Jun 13 2016 18:56
looks fine to me
i see the animation, the collapsable store, and the server status
Andrea Sonny
@andreasonny83
Jun 13 2016 19:00
so, gulp watch is running?
Billy B.
@Azurasky1
Jun 13 2016 19:00
yeah
i can't find the html file that is attached to your game.js document
Andrea Sonny
@andreasonny83
Jun 13 2016 19:01
ok, you should always keep gulp watch running as you develop
that is going to automatically refresh the page as you write the code
in the future it will run more usefull stuff as well
Billy B.
@Azurasky1
Jun 13 2016 19:02
cool cool
where is the html file
Andrea Sonny
@andreasonny83
Jun 13 2016 19:02
is the one you see runng gulp watch
app.js is calling $GAME.drawBoard(csv); and $GAME.drawPlayer(csv, player); from that script
Billy B.
@Azurasky1
Jun 13 2016 19:05
i don't know what that means
or this line of code: <script id="__bs_script__">//<![CDATA[
document.write("<script async src='/browser-sync/browser-sync-client.2.13.0.js'><\/script>".replace("HOST", location.hostname));
//]]></script>
<canvas id="canvas"></canvas>
<script id="__bs_script__">//<![CDATA[
document.write("<script async src='/browser-sync/browser-sync-client.2.13.0.js'><\/script>".replace("HOST", location.hostname));
//]]></script>
<canvas id="canvas"></canvas>
oh i see
creates a method on the global object
and drawPlayer() is just the method that you created
Andrea Sonny
@andreasonny83
Jun 13 2016 19:07
yes, it’s a module
Billy B.
@Azurasky1
Jun 13 2016 19:08
i just want to know what that code up there means, and how i find the index file
a module
Andrea Sonny
@andreasonny83
Jun 13 2016 19:08
what code?
Billy B.
@Azurasky1
Jun 13 2016 19:08
so you are calling that script inside of a different file, with (require)
Andrea Sonny
@andreasonny83
Jun 13 2016 19:08
no, I’m not using require because is not supported by browsers
Billy B.
@Azurasky1
Jun 13 2016 19:09
how do clients use modules
without require
Andrea Sonny
@andreasonny83
Jun 13 2016 19:09
in the index.html I’m including scripts/modules/game.js first and then scripts/app.js
so in the scripts/app.js I can see the $GAME defined inside scripts/modules/game.js
Billy B.
@Azurasky1
Jun 13 2016 19:10
oh
i was just reading it wrong this whole time
whoops
well what does this code mean still
<script id="__bs_script__">//<![CDATA[
document.write("<script async src='/browser-sync/browser-sync-client.2.13.0.js'><\/script>".replace("HOST", location.hostname));
//]]></script>
<canvas id="canvas"></canvas>
Andrea Sonny
@andreasonny83
Jun 13 2016 19:11
that’s is created on the fly by Gulp for creating the connection with browser-sync, the script that refresh your browser as you write the code
we don’t care about that
Andrea Sonny
@andreasonny83
Jun 13 2016 19:18
can you see the store animation? hide/show?
Billy B.
@Azurasky1
Jun 13 2016 19:18
yeah just took a look at your code there
i like your way better than what i wrote
what exactly is player.frame?
i looked up .frame and can't find annything
Andrea Sonny
@andreasonny83
Jun 13 2016 19:21
oh, that is related to the sprite
is defined in app.js
frame width, height, frames and current frame
with and height is the image size inside the images/players/001.png and frames is the total number of frames for the animation
Billy B.
@Azurasky1
Jun 13 2016 19:22
if the modules file comes before that, how is it able to see the value of .frame
wouldn't it just be undefined until the compiler actually reaches the player object
Andrea Sonny
@andreasonny83
Jun 13 2016 19:22
good question
but is not like that
in app.js I’m calling $GAME.drawPlayer(csv, player);
so, you can see, I’m calling GAME.drawPlayer but I’m passing player as a parameter
so I’m sending the player object from app.js into game.js
I’m also sending the canvas object so the game.js can draw into it
Billy B.
@Azurasky1
Jun 13 2016 19:26
i see... your functions are defined, but not called
Andrea Sonny
@andreasonny83
Jun 13 2016 19:26
yep
Billy B.
@Azurasky1
Jun 13 2016 19:27
makes more sense
Andrea Sonny
@andreasonny83
Jun 13 2016 19:27
that’s the pourpose of the modules
Billy B.
@Azurasky1
Jun 13 2016 19:27
to define a whole bunch of functions?
for use later
Andrea Sonny
@andreasonny83
Jun 13 2016 19:27
I define different moodules but all the app logic is run inside app.js
Billy B.
@Azurasky1
Jun 13 2016 19:27
modules in node.js are weird
Andrea Sonny
@andreasonny83
Jun 13 2016 19:28
so I just “prepare” the app but I don’t run any code until app.js starts
Billy B.
@Azurasky1
Jun 13 2016 19:28
in most examples i see, a function is assigned to module.exports
and then nothing else
then that function is required
Andrea Sonny
@andreasonny83
Jun 13 2016 19:28
yes, is not intuitive to understand the logic
but I’m just writing pure vanillajs here not nodejs modules
Billy B.
@Azurasky1
Jun 13 2016 19:29
yeah i like this better than what i've seen of nodejs modules
Andrea Sonny
@andreasonny83
Jun 13 2016 19:29
so, instead of using import and export, the javascript files are manually loaded in the index.hrml
Billy B.
@Azurasky1
Jun 13 2016 19:29
right right
Andrea Sonny
@andreasonny83
Jun 13 2016 19:29
so it should be more clear to understand
Billy B.
@Azurasky1
Jun 13 2016 19:29
yep
Andrea Sonny
@andreasonny83
Jun 13 2016 19:35
ok, I will start removing unused code and defining a better file structure
can you wait before writing new code?
Billy B.
@Azurasky1
Jun 13 2016 19:35
ok!! yeah we have lots of clutter right now
yeah i can do that, just figuring out the best way to animate the sprite right now
Andrea Sonny
@andreasonny83
Jun 13 2016 19:43
ok, pull develop
the file structure should be more clean and understandable now
one html files, one main css file and one main js file
so you don’t get confused
the main files are index.html, app.js and main.scss
they call all the other modules
Billy B.
@Azurasky1
Jun 13 2016 19:46
for some reason it keeps saying that there are no new changes
is this because i am in my own branch?
i am trying to pull the origin
Andrea Sonny
@andreasonny83
Jun 13 2016 19:46
well, you need to checkout develop, yes
you can also git fetch
Billy B.
@Azurasky1
Jun 13 2016 19:51
i was somehow ahead by 6 commits so i just pushed them
Andrea Sonny
@andreasonny83
Jun 13 2016 19:52
on which are branch are you?
Billy B.
@Azurasky1
Jun 13 2016 19:52
that was when i switched to the develop branch
it didn't even make any sense because i commit all my changes to the newchanges branch that i created
Andrea Sonny
@andreasonny83
Jun 13 2016 19:53
are you on develop now?
Billy B.
@Azurasky1
Jun 13 2016 19:53
yes
Andrea Sonny
@andreasonny83
Jun 13 2016 19:53
ok
can you see inside the script folder only app.js and the module folder now?
Billy B.
@Azurasky1
Jun 13 2016 19:54
yes
Andrea Sonny
@andreasonny83
Jun 13 2016 19:54
ok good
so now everything should be more understandable