Matthew Xie
@MatthewX
1
Front page of puzzle 2A (fun) puzzle game that gets your brain going! The instructions are in the game and best played in a new tab.
WARNING: DO NOT PLAY IF YOU GET TRIGGERED TOO EASILY.
Hope you enjoy! :)
51
0
1
Hello everyone! I'm back to coding after the school year has passed! Today, I'm sharing with you guys a game that took me a while and that I started l
HTML, CSS, JS
Hi! I need help with saving numbers and data since repl.it for some reason doesn't let me use local storage :(. Also, I have been thinking about how m
Codeverse Hello @MatthewX, here is how you can make a multiplayer game. Servers can be made in Python, Java, JavaScript, etc, but for this occasion, I would prefer to use Node.js. Here is how to do Node.js: Node.js tutorial. Next, you have to connect Node.js with Socket.io and Express or other packages. Your server show like something like this.
const express = require('express');
const socket = require('socket.io');
//Uses the express function derived from your express variable.
const app = express();
/2 years ago
Hello! I would like to thank all of you for trying out my projects and giving me amazing suggestions. I would also like to celebrate my 150 cycle spec
HTML, CSS, JS
gibbsfreenergy u know i have to be honest, its pretty good that u have content within it, most people here who make websites don't have any content, its just a paragraph of how they love coding...blah blah blah....but tbh the UI here is horrible, if you could make it a bit more appealing it would be fantastic
good luck and tell me when u edit it2 years ago
Hello! So we did this thing in tech class where we had to make a Covid counter on micro:bit so I decided to make one using html and js! This program r
HTML, CSS, JS
Hello guys! I'm back from not programming for a long time! I got this idea when my friend told me about this game called cookie clicker. It seemed fun
HTML, CSS, JS
Hi, how do use put things into a json file then access the thing u put in the json file?
HTML, CSS, JS
PattanAhmed @MatthewX Hi,
You cannot do it in Straight-forward HTML
You need to have help with some Back-end Programming languages to do this...
Thanks!
Hope this helps2 years ago
Coder100 Hello, you cannot do this in HTML. You will have to process things with a backend.2 years ago
SixBeeps Do you want that JSON file to be global (for something like a leaderboard)? You'll need to use a server framework for that.
JS has JSON.parse() which will take in a string of JSON and turn it into an object. Likewise, you can turn an object into a JSON string with JSON.stringify(object).2 years ago
Hello, this is another repl made my me! You use wad the move the character and earn coins to buy cool stuff! Remember to save your progress by pressin
HTML, CSS, JS
When you ccomplete a level then click on another level, All of a sudden the player speed becomes so fast. I tried stopping the loops once you finish a
HTML, CSS, JS
mwilki7 You will need at least 2 blocks.
1 block is a wall,
the other block is a player.
You have the player, now you just need a block.
I use this function to determine whether 2 blocks have collided:
function checkCollision(rect1, rect2)
{
if (rect1.x rect2.x &&
rect1.y rect2.y)
{
return true;
}
return false;
}
and call it with
if (checkCollision(playerblock, wallblock))
{
// Player is colliding with the block
}
`2 years ago
Coder100 Well, right now you will not be able to easily make a block because of how your level is set up.
Try this tutorial.2 years ago
How do you remove a item from a list in js? Like a = "somenumberinlist" and then remove a from the list.
HTML, CSS, JS
PattanAhmed @MatthewX Hi,
I think this website might help you:-
Click here
Thanks!
Hope this helps2 years ago
This is crossy road in python which was made by me use wasd to move the blue character around. I made this game a long time ago(like 3-4 months ago),
Pygame
In my code, i want too check if the number is even and if the number is odd, Im not sure how to do it in js. I tried using % but it didn't work. Pleas
HTML, CSS, JS
PattanAhmed @MatthewX Hi,
Check this small article:-
Use modulus:
function isEven(n) {
return n % 2 == 0;
}
function isOdd(n) {
return Math.abs(n % 2) == 1;
}
You can check that any value in Javascript can be coerced to a number with:
Number.isFinite(parseFloat(n))
This check should preferably be done outside the isEven and isOdd functions, so you don't have to duplicate error handling in both functions.
That's it.
> Reference:- Click here
Thanks!
Hope this helps2 years ago
Coder100 Hi, what's wrong? % gets the remainder:
function isEven(num) { return num % 2 == 0; }
if the remainder is 0, it's divisible.2 years ago
Bookie0 hi there!
i found this:
function isOdd(num) { return num % 2;}
console.log("1 is " + isOdd(1));
console.log("2 is " + isOdd(2));
console.log("3 is " + isOdd(3));
console.log("4 is " + isOdd(4));
from here: https://stackoverflow.com/questions/5016313/how-to-determine-if-a-number-is-odd-in-javascript
here are some other sites that aid you:
https://www.tutorialsmade.com/javascript-find-odd-even-number/
https://css-tricks.com/snippets/javascript/check-if-number-is-evenodd/
https://www.tutorial2 years ago
Hi,this is a puzzle solver game made by me where you use your brain to solve some puzzles. I will do my best to try to add more and more puzzles to th
HTML, CSS, JS
How would I switch the colors of two rectangles? I want to be able so switch back and forth and same with the other squares. For example, I want a = b
HTML, CSS, JS
How come my continue button isn't showing up? Look at my code for charmander.js squirtle.js and bulbasaur.js
HTML, CSS, JS
PattanAhmed @MatthewX Hi,
What is continue button in the function called enemydied?
Can you send how the continue button will be.
Thanks!2 years ago
How do I assign the player move script (in my code) to like a shape? Also, how do i add something to a list in javascript? Finally, can any of you giv
HTML, CSS, JS
How do you make a player move in html and javascript? I want the player to take small steps everytime u press wasd. Also how do i add an element like
HTML, CSS, JS
SixBeeps 1.) You can take input in JS by using event listeners:
var movement = {
left: 0,
right: 0,
up: 0,
down: 0
}
document.addEventListener('keydown', function(event) {
if (document.activeElement === document.body) {
switch (event.keyCode) {
case 65: // A
movement.left = 1;
break;
case 87: // W
movement.up = 1;
break;
case 68: // D
movement.right = 1;
break;
case 83: // S
movement.down = 1;
break;
2 years ago
Coder100 Hi! Classes are not the same as ids. They can be assigned to multiple elements so they can be identified as a group.
Anyways, to get all elements:
document.querySelectorAll('.[class name]').forEach(el => {
// now, el is the element you are looking for, and you can do things accordingly
el.style.background = "orange";
})
`2 years ago
PattanAhmed @MatthewX Hi,
This is an amazing website explaining about Classes (div) in HTML and JavaScript...
Click here
*Hope this helps
Please mark my answer if this helps*2 years ago
SixBeeps Classes in HTML are different than classes in any other language. Here, they are used for grouping together common elements or groups of elements so that they can be styled or identified in bulk.2 years ago
How do I write something in html then be able to change it in java script? Also, how do I do a random choice from a list of objects? Finally, how do i
HTML, CSS, JS