Skip to content

Commit 42f6063

Browse files
author
Ben
committed
bug fixes
1 parent 063355e commit 42f6063

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assetLoader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class AssetLoader{
1515

1616
load_image_sequence(name, file_type, sequence_length){
1717
this._total_assets_to_load += sequence_length;
18-
for(var i = 0; i < image_count; ++i){
18+
for(var i = 0; i < sequence_length; ++i){
1919
this._image_sequences[name][i] = loadImage("assets/images/"+name+"/"+name+"_"+i+"."+file_type, this.asset_loaded.bind(this));
2020
}
2121
}
@@ -29,7 +29,7 @@ export default class AssetLoader{
2929
image(this._images[name], x, y);
3030
}
3131

32-
draw_image_from_sequence(name, frame, x, y){
32+
draw_image_from_sequence(name, x, y, frame){
3333
image(this._image_sequences[name][frame], x, y);
3434
}
3535

@@ -38,7 +38,7 @@ export default class AssetLoader{
3838
}
3939

4040
stop_sound(name){
41-
if ( this._sounds[name].isPlaying() ) {
41+
if ( this._sounds[name].isPlaying() ) {
4242
this._sounds[name].stop();
4343
}
4444
}

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ window.setup = function() {
1818
}
1919

2020
window.draw = function() {
21+
width = base_size.x;
22+
height = base_size.y;
2123
background(255);
2224
vignettes.draw();
2325
}
2426

25-
window.setup_new_canvas = function(width, height){
26-
window.p5Canvas = createCanvas(width, height).canvas;
27+
window.setup_new_canvas = function(i_width, i_height){
28+
window.p5Canvas = createCanvas(i_width, i_height).canvas;
2729
}
2830

2931
window.mouseClicked = function(){

src/vignettes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default class Vignettes{
174174
this._asset_loader.draw_image(name, x, y);
175175
}
176176
draw_image_from_sequence(name, x, y, frame){
177-
this._asset_loader.draw_image_from_sequence(name, frame, x, y);
177+
this._asset_loader.draw_image_from_sequence(name, x, y, frame);
178178
}
179179
play_sound(name){
180180
this._asset_loader.play_sound(name);

0 commit comments

Comments
 (0)