PDA

View Full Version : Long shot, but does anyone know anything about "Phaser" programming?



BehindBlueI's
10-06-2020, 03:05 PM
My son is struggling to get a game working that's part of his computer science class. The teacher hasn't been responsive during distance learning. I know diddly shit about this sort of thing and of no assistance. I know it's a long shot, but if I post the code he's having issues with is there anyone who might be able to advise the issue?

revchuck38
10-06-2020, 03:12 PM
Just remember to set it on "stun".

Andy T
10-06-2020, 03:26 PM
Try searching one of the stackexchange.com sites, or perhaps stackoverflow.com.

Whirlwind06
10-06-2020, 06:38 PM
A quick search shows that is a Java script library. I don’t have a lot of experience with js but I can take a look.


Sent from my iPhone using Tapatalk

Blades
10-06-2020, 06:43 PM
Post it; I'll send it to my son.

BehindBlueI's
10-06-2020, 07:31 PM
A quick search shows that is a Java script library. I don’t have a lot of experience with js but I can take a look.


Sent from my iPhone using Tapatalk


Post it; I'll send it to my son.

Thanks.

Here's the link: https://repl.it/@JohnnySeed/ImaginativeMintcreamConferences#index.html

and join link: https://repl.it/login?goto=/join/qlmvmckf-johnnyseed

*edit*

He thinks line 62 is the problem, but can't figure out what the issue is.

%c %c %c Phaser CE v2.13.1 | Pixi.js | WebGL | WebAudio %c %c %c http://phaser.io/ %c:hearts:%c:hearts:%c:hearts: background: #fb8cb3 background: #d44a52 color: #ffffff; background: #871905; background: #d44a52 background: #fb8cb3 background: #ffffff color: #ff2424; background: #fff color: #ff2424; background: #fff color: #ff2424; background: #fff
TypeError: Cannot set property 'volume' of undefined
at Object.update (/code.js:97:28)
at e.StateManager.update (/phaser.min.js:3:249725)
at e.Game.updateLogic (/phaser.min.js:3:292988)
at e.Game.update (/phaser.min.js:3:292338)
at e.RequestAnimationFrame.updateRAF (/phaser.min.js:3:512432)
at window.requestAnimationFrame.forceSetTimeOut._onLo op (/phaser.min.js:3:512308)
TypeError: Cannot read property 'animations' of undefined
at Object.create (https://imaginativemintcreamconferences--johnnyseed.repl.co/code.js:62:13)
at e.StateManager.loadComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:249226)
at e.Loader.finishedLoading (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:590854)
at e.Loader.processLoadQueue (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:590342)
at e.Loader.asyncComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:591027)
at e.Loader.fileComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:600019)
at XMLHttpRequest.r.onload (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:596254)

Stephanie B
10-06-2020, 07:45 PM
Just remember to set it on "stun".

The settings from Calvin & Hobbes were “obliterate” and “deep fat fry”. In Bloom County, it was “massacre”.

Blades
10-06-2020, 08:22 PM
Thanks.

Here's the link: https://repl.it/@JohnnySeed/ImaginativeMintcreamConferences#index.html

and join link: https://repl.it/login?goto=/join/qlmvmckf-johnnyseed

*edit*

He thinks line 62 is the problem, but can't figure out what the issue is.

%c %c %c Phaser CE v2.13.1 | Pixi.js | WebGL | WebAudio %c %c %c http://phaser.io/ %c:hearts:%c:hearts:%c:hearts: background: #fb8cb3 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=fb8cb3) background: #d44a52 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=d44a52) color: #fff (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=ffffff) fff ; background: #871905; background: #d44a52 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=d44a52) background: #fb8cb3 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=fb8cb3) background: #fff (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=ffffff) fff color: #ff2424 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=ff2424) ; background: #fff (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=fff) color: #ff2424 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=ff2424) ; background: #fff (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=fff) color: #ff2424 (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=ff2424) ; background: #fff (https://pistol-forum.com/usertag.php?do=list&action=hash&hash=fff)
TypeError: Cannot set property 'volume' of undefined
at Object.update (/code.js:97:28)
at e.StateManager.update (/phaser.min.js:3:249725)
at e.Game.updateLogic (/phaser.min.js:3:292988)
at e.Game.update (/phaser.min.js:3:292338)
at e.RequestAnimationFrame.updateRAF (/phaser.min.js:3:512432)
at window.requestAnimationFrame.forceSetTimeOut._onLo op (/phaser.min.js:3:512308)
TypeError: Cannot read property 'animations' of undefined
at Object.create (https://imaginativemintcreamconferences--johnnyseed.repl.co/code.js:62:13)
at e.StateManager.loadComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:249226)
at e.Loader.finishedLoading (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:590854)
at e.Loader.processLoadQueue (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:590342)
at e.Loader.asyncComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:591027)
at e.Loader.fileComplete (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:600019)
at XMLHttpRequest.r.onload (https://imaginativemintcreamconferences--johnnyseed.repl.co/phaser.min.js:3:596254)

This is Blades' son: I found two problems, though I'm not 100% sure how to fix one. First, the var boomSound wasn't declared before it was used, so add var boomSound; to line 12.

The issue on line 62 is that explosion hasn't been initialized yet. I'm not familiar enough with this game framework to know exactly what it needs, but it should be similar to how asteroid is initialized around line 45. That may or may not require first adding a group like on line 40, depends on how this framework works, but either way, the root issue is the same: you're trying to access the animations property of explosion before anything has been added to the explosion variable.

Whirlwind06
10-06-2020, 08:24 PM
It seems to be saying: Cannot set property 'volume' of undefined
at Object.update (/code.js:97:28)

which in the source code is :engineSound.volume = .3;

It could be that this object can't accept ".3" so it's looking for an integer.

Hope this helps.

BehindBlueI's
10-06-2020, 08:51 PM
It seems to be saying: Cannot set property 'volume' of undefined
at Object.update (/code.js:97:28)

which in the source code is :engineSound.volume = .3;

It could be that this object can't accept ".3" so it's looking for an integer.

Hope this helps.

No change.

Whirlwind06
10-07-2020, 06:03 AM
I made some changes, the sound methods and objects seems to be the problem.
I commented out those and the game loads and runs. 61397

So your son needs to check the methods and properites of the sound objects.
He is trying to set the 'volume' property for the engine sound and then play the explotion sound.
BNoth of those are failing so the object constructor or the methods are not correct.

awp_101
10-07-2020, 08:02 AM
The only way I could be more lost in this thread is if it was in Greek or Cyrillic. And I’m ok with that...🙃

UNK
10-07-2020, 08:08 AM
Engineer programmer tried to look its giving him a 404 error on the first one and ask for id/ pw on the second one

critter
10-07-2020, 08:55 AM
My son is struggling to get a game working that's part of his computer science class. The teacher hasn't been responsive during distance learning. I know diddly shit about this sort of thing and of no assistance. I know it's a long shot, but if I post the code he's having issues with is there anyone who might be able to advise the issue?

The code problems are bieng adressed so I'll mention this --- this lack of responsiveness is absolutely typical for CS/language classes. Don't take it as a personal slight.

The rationale is basically -- you must be able to figure it out. It loosely follows the Pareto Principle... 80% of coding is figuring out how to do something, how to make it faster, more user friendly, etc., and 20% is actually doing it. My experience has been - "you're the coder; find the answer; figure it out; make it work."

Guerrero
10-07-2020, 12:47 PM
The code problems are bieng adressed so I'll mention this --- this lack of responsiveness is absolutely typical for CS/language classes. Don't take it as a personal slight.

The rationale is basically -- you must be able to figure it out. It loosely follows the Pareto Principle... 80% of coding is figuring out how to do something, how to make it faster, more user friendly, etc., and 20% is actually doing it. My experience has been - "you're the coder; find the answer; figure it out; make it work."

Because, in the end, "Software is free. Hardware costs money."

BehindBlueI's
10-07-2020, 01:10 PM
On the road. Sent him link. Will update.

BehindBlueI's
10-07-2020, 08:17 PM
The code problems are bieng adressed so I'll mention this --- this lack of responsiveness is absolutely typical for CS/language classes. Don't take it as a personal slight.

The rationale is basically -- you must be able to figure it out. It loosely follows the Pareto Principle... 80% of coding is figuring out how to do something, how to make it faster, more user friendly, etc., and 20% is actually doing it. My experience has been - "you're the coder; find the answer; figure it out; make it work."

Probably not the best approach to an entry level high school class, though. Distance learning has been a good growing experience for doing your own research/learning to learn type stuff but when you're stuck, spent a multitude of hours on a stumbling block, then it's time for a teacher to teach, IMO. That said, he did call today and and is going to help out.

That said, he says it's working now and thanks for everyone's help.

Half Moon
10-07-2020, 08:27 PM
The only way I could be more lost in this thread is if it was in Greek or Cyrillic. And I’m ok with that...🙃


Привет мир!

:-P

MGW
10-07-2020, 09:24 PM
This thread makes me happy. The internet as it should be. People solving problems, perusing interests, and learning new things.

You can’t manufacture this kind of stuff in a classroom. I’m not saying this teacher is doing this intentionally but sometimes getting out of the way is the best teaching method there is.

awp_101
10-07-2020, 09:29 PM
Привет мир!

:-P

Γειά σου Κόσμε!

;)

That Guy
10-07-2020, 11:14 PM
Just remember to set it on "stun".

I don't think the stun setting works worth a damn. Otherwise half the problems in Star Trek could be solved in a few seconds by stunning everyone suspicious, putting them in flexicuffs, and interviewing them once the situation has been contained and the suspects wake back up. Every crew member would be a quick draw artist with their phaser.

Sulu goes mad from Taco Tuesday and is chasing other crew members with a sword, again? Zap & zip.

Kirk is fighting with his evil twin from the universe of bad writing and nobody can tell which is the real captain? Zap & zip (and this is why every crew member has memorised an id verification passphrase...).

Any crew member is acting suspiciously after being exposed to the Mind Bending Vanilla Pudding Spores of Weird Planet 4? Zap & zip.

Mysterious alien suddenly appears on the bridge? Just zap & zip already.

UNK
10-08-2020, 02:20 PM
With one in High school still I have to agree 100%. Shes spent more time in the books, is making great grades and has learned time management. There comes the time a teacher has to teach that doesnt necessarily mean showing how to do it. It can be an aid to help them figure it out theirselves. A guy/girl who can teach to the abilities of that student and their particular needs is a truly exceptional and gifted person.



Probably not the best approach to an entry level high school class, though. Distance learning has been a good growing experience for doing your own research/learning to learn type stuff but when you're stuck, spent a multitude of hours on a stumbling block, then it's time for a teacher to teach, IMO. That said, he did call today and and is going to help out.

That said, he says it's working now and thanks for everyone's help.