Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player graphic sometimes shows on the board, and sometimes does not load #2

Open
davidakimbo opened this issue Apr 29, 2014 · 3 comments
Labels

Comments

@davidakimbo
Copy link
Collaborator

We have an initialize function that loads two graphic files. A grid bitmap image and a bird.

From how we staggered the functions, the grid should load first and then the bird graphic on top. We even put the loadBirdGraphic inside the loadGridGraphic and updated the stage accordingly.

As it currently runs, the bird does not load at all every couple of reloads and we don't know where the issue lies.

Code Snippet:
function loadGridGraphics() {
background = new createjs.Bitmap(backgroundImage);
stage.addChild(background);
setTimeout(stage.update(), 50);
loadBirdGraphics();
stage.update();
}

function loadBirdGraphics() {
bird = new createjs.Bitmap(birdImage);
bird.x = startRow;
bird.y = startCol;
stage.addChild(bird);
stage.update();
}

We call loadGridGraphics at some point after the DOM has loaded.

@DrRobotmck
Copy link

Could you push your most recent code and provide the specific branch you are working on?

@jemise111
Copy link
Collaborator

The latest code is pushed on the code_lessons_functionality branch and the code is from 'application.js.erb' in app/assets/javascript

@DrRobotmck
Copy link

thanks!

@adambray adambray self-assigned this Apr 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants