These are chat archives for Azurasky1/DragonArena

14th
Jun 2016
Billy B.
@Azurasky1
Jun 14 2016 21:48
how is everything going
Andrea Sonny
@andreasonny83
Jun 14 2016 21:48
good
I haven’t work on the project today
learning Typescript
Billy B.
@Azurasky1
Jun 14 2016 21:48
i've been keeping myself busy with your animation script
Andrea Sonny
@andreasonny83
Jun 14 2016 21:49
any question about that?
Billy B.
@Azurasky1
Jun 14 2016 21:49
and i actually came across some of the resources you used because the code matched lol
seems as if we have similar questions
yeah my biggest problem is figuring out
how many pixels the player should travel per second, and how many frames per second i should try to render... also, how long exactly is a "requestAnimationFrame" just one frame right?
Andrea Sonny
@andreasonny83
Jun 14 2016 21:51
you mean, how to control fps?
Billy B.
@Azurasky1
Jun 14 2016 21:52
yeah you can say that
it's really confusing, i don't know how many iterations of the full animation i'm supposed to go through per second to make it smooth
Andrea Sonny
@andreasonny83
Jun 14 2016 21:53
I defined the var frameRate = 5;
Billy B.
@Azurasky1
Jun 14 2016 21:53
and i don't really understand how to properly use "frameCount" and "frameRate"
right right
Andrea Sonny
@andreasonny83
Jun 14 2016 21:53
frameCounter is used for actually animate the avatar, so we have a a sprite of 9 frames
and we need to keep track of the time lapsing in order to render the coorect frame and complete the animation
in the animationLoop function you can see I’m requesting the requestAnimFrame every 5 loop
Billy B.
@Azurasky1
Jun 14 2016 21:55
how come you chose 5
Andrea Sonny
@andreasonny83
Jun 14 2016 21:55
that because I set the frameRate to 5
you can change that frameRate value and the animation will go slower or faster
Billy B.
@Azurasky1
Jun 14 2016 21:56
wouldn't you want to set framerate = to (60 / 9)
yeah i was messing around with that
Andrea Sonny
@andreasonny83
Jun 14 2016 21:56
you can imediately see the result in your browser just changing that variable
Billy B.
@Azurasky1
Jun 14 2016 21:56
right right a lower value is faster
Billy B.
@Azurasky1
Jun 14 2016 21:57
how many pixels should the avatar be moving per second?
Andrea Sonny
@andreasonny83
Jun 14 2016 21:58
well, we don’t know that already
it depends on the avatar size and the relation between the avatar and the world
but we don’t have any graphic at the moment so it’s dofficult to say
does the avar need to move inside a world or just around the canvas size?
Billy B.
@Azurasky1
Jun 14 2016 21:59
we can do either but for now keep it to the canvas
i have another question
say you want to make a function that accesses a property of an object
but you want to do this on any object you want, all using this one function
so you would simply do this right? (function (property) { console.log(object.property); }();
well, i'm trying to do that, i have a method attached to the prototype of an object, and i'm trying to use that method in one of the objects in that class
but when i do it, i get unexpected identifier
Andrea Sonny
@andreasonny83
Jun 14 2016 22:02
Don't have a specific answer for that. I think it depends
Billy B.
@Azurasky1
Jun 14 2016 22:03
i thought that it would just use the parameter as the name of the property but it's giving me an error and i have no idea why
Andrea Sonny
@andreasonny83
Jun 14 2016 22:03
So you have a function declaration and you initialize that using var x = new Foo();?
Billy B.
@Azurasky1
Jun 14 2016 22:04
let me pull something up on jsfiddle
Andrea Sonny
@andreasonny83
Jun 14 2016 22:04
Create your jsfiddle, I will have a look tomorrow morning, it's night time here now
Billy B.
@Azurasky1
Jun 14 2016 22:04
wait don't go to bed yet
this'll only take a minute
ugh it accesses variables from multiple documents
just go to bed we'll discuss more tomorrow
i don't want to have to sift through all this
Andrea Sonny
@andreasonny83
Jun 14 2016 22:16
prepare that jsfiddle so that i can have a look tomorrow
Billy B.
@Azurasky1
Jun 14 2016 22:17
ok i think i might have figured it out but if not i will let you know
i am so close to getting this animation done lol i've been slamming my head for hours
i will admit it was a challenge at times
anyways you have a good night!! :D