i Penguin
@iPenguin
Am an aspiring game/software developer that also happens to be a penguin. Working on random things.
3
Bank Hack PuzzleComplete the puzzle to hack the bank and get rich!
Fleeca: Remember the order of numbers then get the correct trait from the images shown.
Paleto: TBA
The Vault: TBA
A port from NoPixel GTARP bank heists to practice your skills.
13
0
3
I'm trying to create multi-dimensional arrays. The program I have works, but when I run the script again using the HTML button, it doesn't work a seco
HTML, CSS, JS
mwilki7 It looks like it has to do with the data type of w according to the debug console:
image
Try casting 'w' with Number()3 years ago
[JS]
Let's say that we have a matrix of hashtags (of adjustable width "w" and height "h")
w = 5, h = 5
# # #
# # #
# # #
# # #
# # #
stored as
HTML, CSS, JS
mwilki7
Here is pseudocode of how I would approach.
genPathMatrix(l)
{
//
// Create 2 matrices, each the same size of the original matrix
// startingpointmatrix, will contain data on all the places I started creating a path
// if this is full (of 1's) then either:
// • the length specified was too long (should never happen if l 0
{
stepstravelled = stepstravelled + 1
newposition = pick random direction to move from current3 years ago
SixBeeps Here's how I'd solve this.
1.) Create two variables for storing the X and Y values of the last position we were at
2.) Make a for loop from 0 to l - 1
3.) From the last position, look in the four cardinal directions. If there's a #, go to it and set the value to the for loop variable.
Rinse and repeat.3 years ago
For some reason, my way of getting the mouse's Y position (relative to the canvas) is not correct. It varies depending on the height of the canvas.
I
HTML, CSS, JS
Hi, I asked this question a few days ago and didn't get many responses (just one) so I am posting again. In the time since I have worked on my platfor
HTML, CSS, JS
mwilki7 something that's coming to mind
collision()
{
if (player collides with platform)
{
put player on top of platform
put player inside platform's list of objects touching it
}
}
platform = {
move()
{
move everyone touching me by my velocity
move myself
}
}
update()
{
platform.move()
...
}
`3 years ago
eco27 the simplest way to do this is to set the player's velocity to the platform velocity on collision, however this would be bad because it would lead to very jerky movement. You can just gradually decrease / increase the player's velocity by a constant (maybe 0.1 / 100ms) or something when it comes into contact with a platform until it is the same velocity and the platform3 years ago
Hi, thanks for taking the time to check out my problem.
I'm currently working on a platformer and am working on implementing moving platforms. To ge
HTML, CSS, JS
SixBeeps when is collision() run? anchoring with moving platforms is a real hastle btw :)3 years ago
Earlier I asked a question about collision, it turned out I was a doofus and it actually was working the whole time. Now, however, I have no idea how
HTML, CSS, JS
mwilki7 This is what I have to keep some of my objects in bounds
// where 'this' refers to an object that moves
// too far right
if (this.pos.x + this.w > level.width)
{
this.pos.x = level.width - this.w;
}
// too far left
else if (this.pos.x level.height)
{
this.pos.y = level.height - this.h;
}
// too high
else if (this.pos.y < 0)
{
this.pos.y = 0;
}
`3 years ago
So, I'm working on collision detection in this JS platformer I want to make, but it doesn't appear to be working very well.
Context for the code snip
HTML, CSS, JS
mwilki7 This basketball thing I made has basic collision detection.
The snippet I use came from a source online.
https://developer.mozilla.org/en-US/docs/Games/Techniques/2Dcollisiondetection
// a :
// pos: x, y
// b:
// pos: x, y
function checkCollision(a, b)
{
var rect1 = {x: a.pos.x, y: a.pos.y, width: a.w, height: a.h}
var rect2 = {x: b.pos.x, y: b.pos.y, width: b.w, height: b.h}
if (rect1.x rect2.x &&
rect1.y rect2.y)
{
return true;
}
return false3 years ago
Hi, in my current project I have uploaded a text file to my project and I need to figure out how, in my main javascript file, how to turn it into an a
a5rocks https://stackoverflow.com/questions/9838812/how-can-i-open-a-json-file-in-javascript-without-jquery something like this?
Or something like : https://www.codementor.io/codementorteam/how-to-use-json-files-in-node-js-85hndqt324 years ago
Geocube101 This is just a guess, but couldn't you define an array globally and then push 't' into the array?4 years ago
Last updated 1/10/19
{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}[]{}
Welcome to