Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

355
Views
Phaser-3: ¿Hay alguna manera de mover una imagen de un lugar a otro mientras el programa se está ejecutando y que sea visible al hacerlo?

Me gustaría crear un sistema de batalla para un juego de rol, donde se reproduzca una animación de apertura que muestre a los personajes que luchan moviéndose desde un lado de la pantalla a una ubicación en la pantalla. El código actual, los activos y la vista de ejecución actual se proporcionan a continuación;

 <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>battle</title> <script src="phaser.js"></script> <style type="text/css"> body { margin: 0; } </style> </head> <body> <script type="text/javascript"> var config = { type: Phaser.AUTO, width: 1900, height: 900, physics: { default: 'arcade', arcade: { gravity: { y: 0}, debug: false } }, scene: { preload: preload, create: create, update: update, } }; var game = new Phaser.Game(config); function preload(){ this.load.image("background","assets/battle background.png"); this.load.image("hydroBot","assets/water hydrant.png"); }; function create(){ const battle = this.add.image(0,0,"background").setOrigin(0,0); const bot= this.add.image(1000,200,"hydroBot"); bot.setScale(5); }; function update(){ }; </script> </body>

agua_hidrante/hidrobot

el fondo de la batalla

la vista actual al ejecutar el código

muy apreciado gracias :)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sí, verifique la interpolación. Puedes mover la imagen usándola.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!