2d – Platform collision detection problem – player clings to the sides

I have problems with collision detection. I am trying to create a simple platform game but when the player falls or moves too fast, he sometimes detects the wrong collision side. I get the side of the collision by checking the distance between the player and the sides of a block that are exposed to the player. I have also tried to detect the collision one axis at a time, but this problem still occurs.

enter description of image here

blockCollision: function(block) {
        if(this.x + this.width > block.x && this.x < block.x + block.width && this.y + this.height > block.y && this.y < block.y + block.height) {
            let distanceLeft = Math.abs(this.x + this.width - block.x)
            let distanceRight = Math.abs(this.x - (block.x + block.width))
            let distanceTop = Math.abs(this.y + this.height - block.y)
            let distanceBottom = Math.abs(this.y - (block.y + block.height))

            if(distanceLeft < distanceTop && distanceLeft < distanceBottom && !block.collisionSides.includes('L')){
                this.velX = 0
                this.x = block.x - this.width
            }
            if(distanceRight < distanceTop && distanceRight < distanceBottom && !block.collisionSides.includes('R')){
                this.velX = 0
                this.x = block.x + block.width
            }
            if(distanceTop < distanceLeft && distanceTop < distanceRight && !block.collisionSides.includes('T')){
                this.jumping = false
                this.velY = 0
                this.y = block.y - this.height 
            }
            if(distanceBottom < distanceLeft && distanceBottom < distanceRight && !block.collisionSides.includes('B')){
                this.velY = 0
                this.y = block.y + block.height
            }

            if(distanceLeft == distanceTop && !block.collisionSides.includes('LT')){
                this.x = block.x - this.width
                this.y = block.y - this.height
            }
            if(distanceLeft == distanceBottom && !block.collisionSides.includes('LB')){
                this.x = block.x - this.width 
                this.y = block.y + block.height
            }
            if(distanceRight == distanceTop && !block.collisionSides.includes('RT')){
                this.x = block.x + block.width
                this.y = block.y - this.height
            }
            if(distanceRight == distanceBottom && !block.collisionSides.includes('RB')){
                this.x = block.x + block.width 
                this.y = block.y + block.height
            }
        }
    }

jsFiddle

Collision detection – Pong paddle and deflection angles

I am trying to make a pong clone and am having trouble grasping the deflection of the ball. The way I'm approaching is to increase the angle of the distance between the ball and the middle of the racket. However, I can't seem to do the right math and I've tried so many things that I'm starting to doubt what I know.

The problem I face is that I can get the angle I want in degrees, but I can't find the right way to apply it to the velocity vector. Is there a way to take ANY angle and apply it evenly on the speed of the ball?

For example, when the game starts, I set the velocity to -5.5 so that it goes to the left. If I were to calculate the deflection angle at 50 degrees, what operation do I plan to apply this to the speed? Converting degrees to radians will not work as it would create fractional numbers and my speed and position are inches. I only considered the hard coding ranges of the distance between the paddle and the different speeds, but I was hoping that there might be a better way.

malware – Windows threat detection

Is there a structured approach to perform threat detection in Windows?

I have seen NO offer training on Windows forensics, but I can't find any good resource to start with.

I know I was raped because of the ODD repeating itself over and over on my computer, it would take me a while to comment on every buggy activity my computer has been doing since there are a few days .. Anyway, I used malicious bytes (lol) and downloaded CrowdStrike (neat but I can't seem to find a way to use all the information that it collects) and I don't seem close to detecting what is causing these issues, I also have ProcessHacker and I check it once in one in the Network tab to see if it Something is going on, but I cannot assume that everything I am looking at is a threat, so please advise me on how to perform a decent threat search on my computer

algorithms – Detection of similar news

How do the main news portals detect similar news? For example https://www.bbc.com/news/world-asia-china-51431087, if you go to this web page, you can see the "More about this story" section at the bottom of the page. This news was published today, but it detected similar news from a few days ago.

Is there a known algorithm or a library?

4th gurps – How can I prevent detection skills from ruining my game?

I play a smooth villain in a 4th GURPS game. I have the skill to detect lies. Due to the nature of our campaign, which is a murder mystery, I always suspect the person I am talking to is lying to me. Pragmatically, I should be using Detect Lies all the time, but I feel like it would get excessive. I'm hesitating because of a previous D&D campaign, which I can't remember, in which another player was a paladin who was constantly using Detect Evil. I found it hugely repetitive, and it also seemed lopsided. I don't want to be this guy in this game.

Am i thinking about that

Detection site checkyour.space

Opening of a site which allows to recognize the antidetect: https://checkyour.space
Also worked at the start of the previous year. However, I have to stop for a reason that I will not mention.
Please note that this project is entirely non-profit, I do not charge any fees for checking and adding / updating information on anti-detection.

Please be active in this topic to hoist it to the top.
Are you the owner of an antidetect or one customer? He wants me for check that outside? Feel free to write in private messages on the link provided on the site.

For the moment, the detection is implemented, its status:
* LinkenSphere 8.0 – detectable (level 1) not fixed, only chrome
updated 04.02.2020

For paranoids: this service collects all information about the system, browser, location (can be denied), IP address, sound card, fonts, your wife and also the dog. Do you want this data to go somewhere? Otherwise, do not visit this site.

The site was created to test anti-detection systems, not their advertising.

Please note that this site only works with Chrome and that "detected" means that an anti-detection system is found.
SEMrush

Collision Detection – How not to move my character when it collides with Unity and Box Collider?

If you don't want collisions to push your objects, you can make them kinematic (under Rigidbody 2D -> Body type -> Kinematic)

This tells the physics engine "I will take responsibility for the movement of this object, including collisions, so you won't have to push this object to resolve penetration"

The trick is that you must then take on this responsibility. If you simply teleport one object to another by defining its position, the physics engine will not intervene to stop or repel them, because you told it that you would manage this part.

Instead, you will want to use methods such as MovePosition to move to the next collision, but not through it, or use shapecast queries to check how far you can move your character in open space before to move them there.

collision detection – what's wrong with my line segment plane intersection code?

I am the algorithm on this website for my line segment intersection test code. But when I look at my line segment and my plan intersect, it doesn't produce the right point of intersection.

Here is an example of what I'm talking about.
intersection test failure

Here is my code for the test

public static bool SegmentPlane(Vector3 p1, Vector3 p2, float distance, Vector3 normal, out float time, out Vector3 point)
{
    time = 1f;
    point = Vector3.zero;


    time = (Vector3.Dot(normal, normal * distance) - Vector3.Dot(normal, p1)) / Vector3.Dot(normal, (p2 - p1).normalized);
    if(time >= 0f && time <= 1f)
    {
        point = p1 + time * (p2 - p1).normalized;
        return true;
    }
    return false;
}

collision detection – Collisions with rock and player (spaceship)

I'm trying to do when the rock hits the spaceship or the player, it should decrease the health of the health bar but when I run it, it doesn't work. rock randomly decreases health. how can i fix this?

# 1 - Import library

import pygame
from pygame.locals import *
import math
randomly import

pygame.init ()
pygame.display.set_caption (& # 39; Rescue mission! & # 39;)
clock = pygame.time.Clock ()
width, height = 840, 680
screen = pygame.display.set_mode ((width, height))
keys = (False, False, False, False)
playerpos = (380,620)
acc = (0,0)
laser beams = ()
objecttimer = 100
objecttimer1 = 0
rocks = ((640,100))
health value = 194
lifeboostertimer = 200
lifeboostertimer1 = 0
lifebooster = ((640,100))

player = pygame.image.load (& # 39; spacecraft.png & # 39;)
background = pygame.image.load ("background.png")
background = pygame.transform.scale (background, (840, 680))
laserbeam = pygame.image.load ("laserbeam2.png")
rockpic1 = pygame.image.load ("ro.png")
rockpic = rockpic1
healthbar = pygame.image.load ("healthbar.png")
health = pygame.image.load ("health.png")
lifeboost = pygame.image.load ("lifeboost.png")
lifeboost1 = lifeboost

while 1:
objecttimer- = 1
lifeboostertimer- = 1
# 5 – Clear the screen before drawing it again
screen.fill (0)

# 6 - putting the images of the game on screen



screen.blit(background,(0,0))
#screen.blit(lifeboost, (100,100))

position = pygame.mouse.get_pos()
angle = math.atan2(position(1)-(playerpos(1)+32),position(0)-(playerpos(0)+26))
playerrot = pygame.transform.rotate(player, 360-angle*57.29)
playerpos1 = (playerpos(0)-playerrot.get_rect().width/2, playerpos(1)-playerrot.get_rect().height/2)
screen.blit(playerrot, playerpos1)

for bullet in laserbeams:
    index=0
    velx=math.cos(bullet(0))*10
    vely=math.sin(bullet(0))*10
    bullet(1)+=velx
    bullet(2)+=vely
    if bullet(1)<-64 or bullet(1)>840 or bullet(2)<-64 or bullet(2)>680:
        laserbeams.pop(index)
    index+=1
    for projectile in laserbeams:
        laserbeam1 = pygame.transform.rotate(laserbeam, 360-projectile(0)*57.29)
        screen.blit(laserbeam1, (projectile(1), projectile(2)))
# Draw Rocks
if objecttimer==0:
    rocks.append((840, random.randint(50,430)))
    objecttimer=90-(objecttimer1*2)
    if objecttimer1>=35:
        objecttimer1=35
    else:
        objecttimer1+=6
index=0
for rock in rocks:
    if rock(0)<-1:
        rocks.pop(index)
    rock(0)-=7
    # - Attack castle(change to Attack spaceship later on)
    rockrect=pygame.Rect(rockpic.get_rect)
    playerrect = pygame.Rect(player.get_rect)
    rockrect.top=rock(1)
    rockrect.left=rock(0)

    if rockrect.colliderect(playerrect):
        healthvalue -= random.randint(5,20)

        rocks.pop(index)
    # Check for collisions
    index1=0
    #index3=0
    for bullet in laserbeams:
        bullrect=pygame.Rect(laserbeam.get_rect())
        bullrect.left=bullet(1)
        bullrect.top=bullet(2)

        if rockrect.colliderect(bullrect):
            acc(0)+=1
            rocks.pop(index)

            laserbeams.pop(index1)

        index1+=1
    index += 1


# Next Rock

    #index+=1
#for rock in rocks:
    #screen.blit(rockpic,rock)

# Draw 1-UP image
if lifeboostertimer==0:
    lifebooster.append((840, random.randint(50,430)))

    lifeboostertimer=1000-(lifeboostertimer1*1)
    if lifeboostertimer1>=15:
        lifeboostertimer1=15

    else:
        lifeboostertimer1+=3
index2=0

# Makes object move
for lifeboost in lifebooster:
    if lifeboost(0)<-1:
        lifebooster.pop(index2)
    #speed of 1-UP
    lifeboost(0)-=7


    screen.blit(lifeboost1,lifeboost)


    lifeboosterrect=pygame.Rect(lifeboost1.get_rect())
    lifeboosterrect.top=lifeboost(1)
    lifeboosterrect.left=lifeboost(0)
    #if lifeboosterrect.left<1:
        #healthvalue += random.randint(5,20)

    # Check for collisions (if hit for lifebooster give more health)
    #index=0

    #index2=0
    index3=0


    for bullet in laserbeams:
        bullrect=pygame.Rect(laserbeam.get_rect())
        bullrect.left=bullet(1)
        bullrect.top=bullet(2)

        if lifeboosterrect.colliderect(bullrect):
            acc(0)+=1
            lifebooster.pop(index2)
            laserbeams.pop(index3)
            print ("rock poped")
            healthvalue += random.randint(5,20)
        index3+=1

# - Next 1-UP image
# index2 + = 1 # can probably take this line and the next line
#for lifeboost in lifebooster:
screen.blit (lifeboost1, lifeboost)
index + = 1
for rock in rocks:
screen.blit (rockpic, rock)

# 6.4 - Draw clock
font = pygame.font.Font(None, 24)
survivedtext = font.render(str((90000-pygame.time.get_ticks())/60000)+":"+str((90000-pygame.time.get_ticks())/1000%60).zfill(2), True, (0,0,0))
textRect = survivedtext.get_rect()
textRect.topright=(635,5)
screen.blit(survivedtext, textRect)

# 6.5 - Draw health bar
screen.blit(healthbar, (5,5))
for health1 in range(healthvalue):
    screen.blit(health, (health1+8,8))

# 7 - update the screen
pygame.display.flip()
clock.tick(60)
# 8 - loop through the events
for event in pygame.event.get():
    #print (event)
    # check if the event is the X button 
    if event.type==pygame.QUIT:
        pygame.quit() 
        exit(0) 

       # if it is quit the game
    if event.type == pygame.KEYDOWN:
        if event.key==K_UP:
            keys(0)=True

        elif event.key==K_LEFT:
            keys(1)=True

        elif event.key==K_DOWN:
             keys(2)=True

        elif event.key==K_RIGHT:
            keys(3)=True
    if event.type == pygame.KEYUP:
        if event.key==pygame.K_UP:
            keys(0)=False
        elif event.key==pygame.K_LEFT:
            keys(1)=False
        elif event.key==pygame.K_DOWN:
            keys(2)=False
        elif event.key==pygame.K_RIGHT:
            keys(3)=False
    if event.type==pygame.MOUSEBUTTONDOWN:
        position=pygame.mouse.get_pos()
        acc(1)+=1
        laserbeams.append((math.atan2(position(1)-(playerpos1(1)+32),position(0)-(playerpos1(0)+26)),playerpos1(0)+32,playerpos1(1)+32))


# 9 - Move player
if keys(0):
    playerpos(1)-=5
elif keys(2):
    playerpos(1)+=5
if keys(1):
    playerpos(0)-=5
elif keys(3):
    playerpos(0)+=5

Search for a partner to do marketing / sales for an IP research service (VPN, Proxy, digital detection).

Hi!

I have recently developed and launched an IP search service and I am currently looking for someone to help me with sales.

Your job is to market the product as best as possible. In exchange, you would receive 50% of the profits.
SEMrush

You can find more information about the product here.

Glad to answer any questions or discuss details via a private message.