[HTML5] Problema con Google Chrome, non so che sia.

luigi777

Utente Attivo
14 Feb 2008
1.086
1
38
42
Massa, Italy
Salve, perché dopo l'aggiornamento a Google Chrome 37 non funziona più il mio codice.?

Invece con internet explorer 11, stesso codice senza nessuna modifica funziona.?

mi sapete dire come mai ?

Non da nessun errore chrome .. e nemmeno firefox e pure non vanno,

e mi va solo con ie11 come mai?

grazie mille e buon inizio settimana.
 
Ultima modifica di un moderatore:

luigi777

Utente Attivo
14 Feb 2008
1.086
1
38
42
Massa, Italy
problema quasi risolto.. è un problema di switch(screen),

ma non so se è vero.
Perché 1 mese fa funzionava senza problemi.

Ecco i codice incriminato:

PHP:
var screen =2;
function gameloop() 
{
	switch(screen)
	{
		case 1:
		game.addEventListener('click', function(){ 
				
				screen = 2;
				
			}, false);  
			
		game.addEventListener('touchstart', function()
			{
				screen = 2;
				
			}, false);
			
			drawIntro();	
		break;
		
		case 2:
			game.addEventListener('mousemove', function(ev){
					
				if (ev.layerX || ev.layerX == 0) { // Firefox
					posy = ev.layerY;
				} else if (ev.offsetX || ev.offsetX == 0) { // Opera & Chrome
					posy = ev.offsetY;
				}
			}, false);
			game.addEventListener('click', function()
			{
				if (ball.vx == 0) { 
						pong_started.play();
						ball.vx = 10; ball.vy = 0.4; 
				}
			}, false);  
			game.addEventListener('touchstart', function()
			{
				if (ball.vx == 0) {  
					ball.vx = 10; ball.vy = 0.4;
					pong_started.play();
				}	
			}, false);
			game.addEventListener('touchmove', function(ev){
				if (!ev)
				ev = event;
				posy = ev.touches[0].pageY;
				return false;
			}, false);
			
			draw();
			update();
			
			background_music.play();
			background_music.loop = true;
			
		break;
	}
}

se metto screen=2; il gioco parte.. ma se metto screen=1, funziona il start game , ma non mi clicca il mouse.

che vuole dire?


perché su ie 11 , forse lui ignora l'errore e fa funzionare lo stesso. giusto?

mi date una mano?

grazie mille.
 

luigi777

Utente Attivo
14 Feb 2008
1.086
1
38
42
Massa, Italy
ora ho messo con un 'if:

ma va solo con internet explorer 11 . con firefox e google nulla.

PHP:
var screen=1;
function gameloop() 
{	
	
	if (screen == 1)
	{
		game.addEventListener('click', function(){ 
				
				screen = 2;
				
			}, false);  
			
		game.addEventListener('touchstart', function()
			{
			screen = 2;
				
			}, false);
			
			drawIntro();	
	}	
	else if(screen == 2)
	{
			game.addEventListener('mousemove', function(ev){
					
				if (ev.layerX || ev.layerX == 0) { // Firefox
					posy = ev.layerY;
				} else if (ev.offsetX || ev.offsetX == 0) { // Opera & Chrome
					posy = ev.offsetY;
				}
			}, false);
			game.addEventListener('click', function()
			{
				if (ball.vx == 0) { 
						pong_started.play();
						ball.vx = 10; ball.vy = 0.4; 
				}
			}, false);  
			game.addEventListener('touchstart', function()
			{
				if (ball.vx == 0) {  
					ball.vx = 10; ball.vy = 0.4;
					pong_started.play();
				}	
			}, false);
			game.addEventListener('touchmove', function(ev){
				if (!ev)
				ev = event;
				posy = ev.touches[0].pageY;
				return false;
			}, false);
			
			draw();
			update();
			
			background_music.play();
			background_music.loop = true;
			
		
	}
}
 

luigi777

Utente Attivo
14 Feb 2008
1.086
1
38
42
Massa, Italy
è un problema di chrome 37, perché provato su cellulare sybian opera 12 (Vecchia versione),
il gioco funziona regolarmente come fosse un mese fa, ma non capisco perché qui no.
idee?

grazie mille.
 
Discussioni simili
Autore Titolo Forum Risposte Data
D Problema con <audio> di HTML5 HTML e CSS 0
D Drag & drop HTML5. Problema con ie e chrome! HTML e CSS 1
A problema url html5 video HTML e CSS 1
Frank10 Problema w3c warning HTML5 -.-" HTML e CSS 5
Frank10 Problema w3c e doctype html5 HTML e CSS 2
novello88 Problema convalida W3C pagina HTML5 HTML e CSS 8
MarcoGrazia HTML5 <picture> e i file source HTML e CSS 2
D pattern html5 non va con asterisco HTML e CSS 6
B Vendo Temi per Wordpress e template html5 Altri Annunci 0
C Html5 game HTML e CSS 1
matteoraggi [PHP] Trasformare una animazione html5 in un file video PHP 0
A [Javascript] problemi con javascrip e posizione GPS html5 Javascript 6
C Aggiornare App Html5 HTML e CSS 2
P [Javascript] [html5] operazioni matematiche come output di un form Javascript 7
P Implementare gioco html5 in pagina web HTML e CSS 3
xone [Offro] Realizzazione template html5 css3 creati da zero Offerte e Richieste di Lavoro e/o Collaborazione 0
G Dreamweaver e html5 Windows e Software 9
E Formato data datepicker HTML5 HTML e CSS 5
R Slideshow di immagini in HTML5 HTML e CSS 1
S pulsanti sonori in html5 HTML e CSS 3
T modificare un template html5 HTML e CSS 6
P html5 e css per ie10 e 11 HTML e CSS 6
N Passaggio da xhtml strict ad HTML5, problemi di charset!! HTML e CSS 1
L Funzione per API HTML5 Javascript 0
M Validazione documenti HTML5 HTML e CSS 0
A Modificare un template html5 Webdesign e Grafica 1
R Consiglio Snippet HTML5 Base HTML e CSS 2
C Attributi Tag <html> in HTML5 HTML e CSS 2
glm2006ITALY Editor HTML5 HTML e CSS 6
I <section> e <article> in HTML5 HTML e CSS 1
M HTML5 datalist evento onchange HTML e CSS 1
M Controls volume in HTML5 HTML e CSS 0
J [RISOLTO] Struttura pagina con HTML5 e CSS HTML e CSS 7
S convertire html5/jquery app in apk per android jQuery 0
L [RISOLTO]inserire funzione in un oggetto (HTML5+canvas) Javascript 2
M embedare streaming in HTML5 compatibili con Android HTML e CSS 1
F Blog e Forum HTML5 / Tekhy Presenta il tuo Sito 22
A Webcam HTML5 HTML e CSS 1
P Bug IE 7/8 slideshow inserito in pagina html5 Parallax HTML e CSS 4
P Bug IE 7 slideshow inserito in pagina html5 Parallax Javascript 1
J html5 e standard HTML e CSS 2
P attuale compatibilità HTML5 con i principali browser HTML e CSS 6
G html5 ed audio gestito da javascript Javascript 2
YellowMan HTML5 off-line web application HTML e CSS 1
K [consigli] CMS in HTML5 con Responsive Web Design e semantica schema.org CMS (Content Management System) 3
L HTML5 Boilerplate HTML e CSS 3
YellowMan HTML5 WebSocket: mi fate un esempio di come funziona? HTML e CSS 1
YellowMan Video HTML5: in locale funziona, on-line no! HTML e CSS 1
novello88 Come faccio a sapere se il mio browser supporta HTML5? HTML e CSS 2
voldemort HTML5 e CSS3: ancora troppo presto? HTML e CSS 3

Discussioni simili