These are chat archives for pixijs/pixi.js

27th
Feb 2018
mcpll
@mcpll
Feb 27 2018 08:29
hi all
i ha ve question about pixi loader
pixi loader works like a preloader.js? so it save the image into webbrowser cache?
hellofolks
@hellofolks
Feb 27 2018 22:05
Guys what is the problem of for loops in ticker?
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:04
^_^ fixed in pixi issues
hellofolks
@hellofolks
Feb 27 2018 23:06
But what is special in slot game?
It is also another kind of game like all games
With the way you are lookin' to it, so it is also rude sharing a tetris game logic because many devs are creating tetris games or fps games.......
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:08
the market is over-saturated with vacansies for slot projects
so its like there's always a competition about slots and you just asked to help you compete in it :)
hellofolks
@hellofolks
Feb 27 2018 23:09
In the and sharing and advising all kind of game logics becomes impossible this way. But the thing I was asking not specifically in slot, it was mostly based on for loop in ticker
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:09
its ok when its actual graphical issue, but really, that was game logic. Sorry that I'm nervous about it
yeah, but there are different places for it and i just overreacted
its more about "coding & 2d game design" in html5 gamedevs forum
hellofolks
@hellofolks
Feb 27 2018 23:10
Because I asked many IRC JavaScript channels and many people told this is related with renderAnimationFrame and for loop problem
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:11
oh
OH
that's fun :)
lol
hellofolks
@hellofolks
Feb 27 2018 23:11
Messages still exist
Then I opened an issue
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:12
well, write animation code is a task on its own
it has special tricks like i did in your case
hellofolks
@hellofolks
Feb 27 2018 23:12
Yeah of course
You are completely right
But the thing was looking like also a problem related with async and sync problem
rAf and for
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:13
well, its kinda related
hellofolks
@hellofolks
Feb 27 2018 23:14
So you mean while we are looping a for loop
rAF frames are not waiting for it?
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:14
there's such thing as "loop invariant"
they are waiting
its just general problem in programming
there are pre-conditions and post-conditions for everything
ever y time you write For cycle with strange logic, think what is invariant for it
what condition is "true" for every iteration
like there, it shoudl be "I moved all squares that I encountered by the same amount of pixels"
hellofolks
@hellofolks
Feb 27 2018 23:16
yes
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:17
one of solution is making it async - marking a flag or adding an event that'll be handled later and stop this column after For is done.
hellofolks
@hellofolks
Feb 27 2018 23:19
like UPDATE_PRIORITY ?
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:20
yep
but i dont recommend to do async solutions if you have problems with sync
that'll only complicate things for you
also, actual pixi way of things will be storing those squares in container :)
and moving container
that way you dont have to modify Y except for those who are going for the next period
but taht logic was discussed in issues sooo many times
and appeared on forums
so taking it all into account, that's really getting on people nerves . I even had a thought about making ideal slots implementation so people dont bother us with it
like, MOST of the jobs for pixi and phaser are slots
it was three-match before
now its slots
hellofolks
@hellofolks
Feb 27 2018 23:23
What I Don't understand right now is
[0,1,2,3,4] we have
And looping over it
Every frame as I understand waits for it
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:23
yep
hellofolks
@hellofolks
Feb 27 2018 23:23
When we come to the end as [4] = 4
if it is the thing I'm lookin I shift it
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:24
no it'll be at [2]
you dont move objs around
the real stopper can be inside the array
and thus one half of arrays gets moved by addY and for the second addY is 0
hellofolks
@hellofolks
Feb 27 2018 23:25
wait what? so for loop works in half at the same time?
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:26
[0,1,2,3,4] , if your "if" worked for element 2, then elements 3,4 will be moved by addY=0
because you set it to zero in the middle of FOR
hellofolks
@hellofolks
Feb 27 2018 23:26
But when it comes to the end it is checking for the match
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:26
you've violated the loop invariant, then math went away to smoke under the rain.
hellofolks
@hellofolks
Feb 27 2018 23:27
I can only shift the last element
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:27
its not last in "objs"
and you iterate over objs and not over "array"
hellofolks
@hellofolks
Feb 27 2018 23:27
OMG!
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:27
what is the time in your timezone?
hellofolks
@hellofolks
Feb 27 2018 23:28
You made my day! also two days
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:28
OMG
hellofolks
@hellofolks
Feb 27 2018 23:28
and now 2:25
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:28
same timezone.. where are you?
yeah
hellofolks
@hellofolks
Feb 27 2018 23:29
By the way thank you for for guidance and helping hand
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:29
anyway, want invite to slack to bother me there next time?
hellofolks
@hellofolks
Feb 27 2018 23:29
OFC! :D
Ivan Popelyshev
@ivanpopelyshev
Feb 27 2018 23:30
PM me your email and ill get you invite, it'll help you to understand which things we are really working on.
hellofolks
@hellofolks
Feb 27 2018 23:50
Nights everyone!