Hello & Thanks ,
I am fairly new to javascript coding . And am working with a js library named Quickjs .
I would like to learn how to read/understand any javascript library :
In reference to Quickjs library: https://github.com/dgsprb/quick/wiki/API
My complete source code http://pastebin.com/YezzaXX6
Source code for Quick.js pastebin.com/1fhT2uBY
It occurs to me that maybe I could find out which button was clicked by using the the hasTag method .
But I get into trouble , error: ~paddle-main-NOW.js:63 Uncaught TypeError: RestartBtn.hasTag is not a function
when I try: RestartBtn.prototype.update = function () {
if (this.pointer.getPush()) {
// if (GameObject.hasTag(“restartBtn”)) { // doesnt work
// if (this.hasTag(“restartBtn”)) { // doesnt work
if (RestartBtn.hasTag("restartBtn")) {
alert('restartBTN = ' + restartBTN); }; }; };
Pls , tell me why the following works , and the above doesnt ?
Ball.prototype.onCollision = function (GameObject) {
var collision = this.getCollision(GameObject);
if (GameObject.hasTag("lies02")) {
lies02.setLeft(0);
Thanks…Vern