Find Jobs
Hire Freelancers

platformer

$10-30 CAD

Closed
Posted about 1 year ago

$10-30 CAD

Paid on delivery
its a 2d platformer I'm working on and I cant figure out what I'm doing wrong <!DOCTYPE html> <html> <head> <title>Platformer Game</title> <link rel="stylesheet" type="text/css" href="[login to view URL]" /> </head> <body> <canvas id="canvas" width="640" height="480"></canvas> <script src="[login to view URL]"></script> </body> </html> canvas { border: 1px solid black; } // Initialize variables var canvas = [login to view URL]("canvas"); var ctx = [login to view URL]("2d"); var player = { x: 50, y: 380, width: 32, height: 32, speed: 5, velX: 0, velY: 0, jumping: false }; var keys = []; var friction = 0.8; var gravity = 0.2; // Set up key listeners [login to view URL]("keydown", function(e) { keys[[login to view URL]] = true; }); [login to view URL]("keyup", function(e) { keys[[login to view URL]] = false; }); // Main game loop function update() { // Handle player movement if (keys[38] || keys[32]) { // Jump if (![login to view URL]) { [login to view URL] = true; [login to view URL] = [login to view URL] * 2; } } if (keys[39]) { // Move right if ([login to view URL] < [login to view URL]) { player.velX++; } } if (keys[37]) { // Move left if ([login to view URL] > [login to view URL]) { player.velX--; } } // Apply friction and gravity to player movement [login to view URL] *= friction; [login to view URL] += gravity; // Update player position player.x += [login to view URL]; player.y += [login to view URL]; // Handle player collision with walls if (player.x >= [login to view URL] - [login to view URL]) { player.x = [login to view URL] - [login to view URL]; } else if (player.x <= 0) { player.x = 0; } if (player.y >= [login to view URL] - [login to view URL]) { player.y = [login to view URL] - [login to view URL]; [login to view URL] = false; } // Clear canvas and draw player [login to view URL](0, 0, [login to view URL], [login to view URL]); [login to view URL] = "#FF0000"; [login to view URL](player.x, player.y, [login to view URL], [login to view URL]); // Call update function again requestAnimationFrame(update); } // Start the game loop update();
Project ID: 36272780

About the project

6 proposals
Remote project
Active 1 yr ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average $20 CAD for this job
User Avatar
Hello, I am very interested in your job posting titled platformer. I possess the necessary JavaScript, CSS, HTML5, HTML, jQuery / Prototype skills, and more. I have over 10 years of professional development experience. As a full-stack developer, I am an expert in both front-end and back-end development. I can help solve the problem with your 2D platformer game by checking the code logic, optimizing performance and fixing errors. Thank you for taking the time and evaluating my proposal. I am eagerly looking forward to the opportunity to speak with you soon.
$18 CAD in 1 day
4.9 (6 reviews)
2.2
2.2
User Avatar
Hi buddy im oussama a website developer i see you have some problems in your code . i can help you i had some like that when i was learning if you want i can help you just message me . and thank you for your time if you ask about my skills im good in : HTML CSS/SASS JAVASCRIPT/ JQUERY BOOTSTRAP and some other frameworks thank you for your time.
$20 CAD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Há dois problemas no código que precisam ser corrigidos: A declaração do estilo CSS está fora das tags <style> e </style>, o que pode estar causando erros ao tentar aplicar o estilo. As chaves de fechamento } da declaração de estilo e da declaração do objeto player estão faltando. Posso Oferecer o Código com as Devidas correções!
$30 CAD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello sir, I can help you if you want about this project or we can manage about it. Sometimes you gonna miss so part
$20 CAD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of CANADA
Pincher Creek, Canada
0.0
0
Member since Mar 26, 2023

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.