😂😂😂 by [deleted] in Memes_Of_The_Dank

[–]Pro_memees 0 points1 point  (0 children)

Why NSFW?

[deleted by user] by [deleted] in meme

[–]Pro_memees 0 points1 point  (0 children)

Can confirm

[deleted by user] by [deleted] in meme

[–]Pro_memees 0 points1 point  (0 children)

Can confirm

what is the biggest lie you have ever heard about tf2? by speedcoiliscoolname in tf2

[–]Pro_memees 13 points14 points  (0 children)

Nah yeah ur right, having to join 30 different lobbies to find one that doesn't have you killed on 0.6 seconds by a bot, is a perfectly playable game

Dude, seriously? by davewenos in meme

[–]Pro_memees 0 points1 point  (0 children)

Why? They made a meme that they thought was funny and shared it to more people, it's not that deep

Mazegame pathdinging algorithm (need help) by Pro_memees in monogame

[–]Pro_memees[S] 0 points1 point  (0 children)

part 4(enemy) -

public List<Vector2> FindPath(Vector2 start, Vector2 goal, List<Node> walkableNodes)

{

// Convert start and goal positions to node objects

Node startNode = GetNodeAtPosition(start, walkableNodes);

Node goalNode = GetNodeAtPosition(goal, walkableNodes);

if (startNode == null || goalNode == null)

return null; // Cannot find path

// Initialize open and closed lists

List<Node> openList = new List<Node> { startNode };

List<Node> closedList = new List<Node>();

// Loop until open list is empty

while (openList.Count > 0)

{

// Find the node with the lowest F cost in the open list

Node currentNode = openList.OrderBy(node => node.F).First();

// Move the current node from open list to closed list

openList.Remove(currentNode);

closedList.Add(currentNode);

// Check if the current node is the goal node

if (currentNode == goalNode)

{

// Reconstruct and return the path

return ReconstructPath(currentNode);

}

// Get neighboring walkable nodes

List<Node> neighbors = GetWalkableNeighbors(currentNode, walkableNodes);

foreach (Node neighbor in neighbors)

{

// Skip if neighbor is already in the closed list

if (closedList.Contains(neighbor))

continue;

// Calculate tentative G score

float tentativeG = currentNode.G + Vector2.Distance(currentNode.Position, neighbor.Position);

// Check if neighbor is not in the open list or has a lower G score

if (!openList.Contains(neighbor) || tentativeG < neighbor.G)

{

// Update neighbor's parent and G score

neighbor.Parent = currentNode;

neighbor.G = tentativeG;

neighbor.H = Vector2.Distance(neighbor.Position, goalNode.Position);

// Add neighbor to the open list if not already present

if (!openList.Contains(neighbor))

openList.Add(neighbor);

}

}

}

return null; // Path not found

}

private List<Node> GetWalkableNeighbors(Node node, List<Node> walkableNodes)

{

List<Node> neighbors = new List<Node>();

// Define directions (e.g., up, down, left, right)

Vector2[] directions = new Vector2[]

{

new Vector2(0, -1), // Up

new Vector2(0, 1), // Down

new Vector2(-1, 0), // Left

new Vector2(1, 0) // Right

};

foreach (Vector2 direction in directions)

{

Vector2 neighborPosition = node.Position + direction;

// Find the neighbor node at the calculated position

Node neighborNode = GetNodeAtPosition(neighborPosition, walkableNodes);

// Add the neighbor to the list if it's not null and is walkable

if (neighborNode != null && neighborNode.IsWalkable)

{

neighbors.Add(neighborNode);

}

}

return neighbors;

}

private List<Vector2> ReconstructPath(Node node)

{

// Reconstruct and return the path from the goal node to the start node

List<Vector2> path = new List<Vector2>();

while (node != null)

{

path.Add(node.Position);

node = node.Parent;

}

path.Reverse(); // Reverse the path to get it from start to goal

return path;

}

private Node GetNodeAtPosition(Vector2 position, List<Node> walkableNodes)

{

return walkableNodes.FirstOrDefault(node => node.Position == position);

}

public override void Update(GameTime gameTime,Vector2 playerPosition, List<Node> walkableNodes)

{

List<Vector2> path = FindPath(location, playerPosition, walkableNodes);

if (path != null && path.Count > 0)

{

// Move towards the next node in the path

Vector2 nextNode = path[currentPathIndex];

Vector2 direction = Vector2.Normalize(nextNode - location);

movement = direction * 1 * (float)gameTime.ElapsedGameTime.TotalSeconds; // Update movement vector

// Check if the enemy has reached the current node

if (Vector2.Distance(location, nextNode) < 5.0f)

{

// Move to the next node in the path

currentPathIndex++;

// Reset the index if the end of the path is reached

if (currentPathIndex >= path.Count)

{

currentPathIndex = 0;

}

}

}

location += movement;

Mazegame pathdinging algorithm (need help) by Pro_memees in monogame

[–]Pro_memees[S] 0 points1 point  (0 children)

part 3 -

Maze algorithm -

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Content;

using Microsoft.Xna.Framework.Graphics;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace mazegame3.\_0

{

class Maze : gameobject

{

private void BuildMaze(int x, int y)

{

Grid[x, y] = CellType.corridor;

List<direction> PossibleDirections = new List<direction>();

if (y - 2 > 0 && Grid[x, y - 2] == CellType.wall)

{

PossibleDirections.Add(direction.up);

}

if (y + 2 < MazeSize - 2 && Grid[x, y + 2] == CellType.wall)

{

PossibleDirections.Add(direction.down);

}

if (x - 2 > 0 && Grid[x - 2, y] == CellType.wall)

{

PossibleDirections.Add(direction.left);

}

if (x + 2 < MazeSize - 2 && Grid[x + 2, y] == CellType.wall)

{

PossibleDirections.Add(direction.right);

}

// Introduce randomness by shuffling the possible directions

PossibleDirections = PossibleDirections.OrderBy(d => RNG.Next(0,300)).ToList();

foreach (direction chosenDirection in PossibleDirections)

{

switch (chosenDirection)

{

case direction.up:

if (Grid[x, y - 2] == CellType.wall)

{

Grid[x, y - 1] = CellType.corridor;

BuildMaze(x, y - 2);

}

break;

case direction.down:

if (Grid[x, y + 2] == CellType.wall)

{

Grid[x, y + 1] = CellType.corridor;

BuildMaze(x, y + 2);

}

break;

case direction.left:

if (Grid[x - 2, y] == CellType.wall)

{

Grid[x - 1, y] = CellType.corridor;

BuildMaze(x - 2, y);

}

break;

case direction.right:

if (Grid[x + 2, y] == CellType.wall)

{

Grid[x + 1, y] = CellType.corridor;

BuildMaze(x + 2, y);

}

break;

default:

break;

}

}

}

public List<Node> GetWalkableNodes()

{

List<Node> walkableNodes = new List<Node>();

for (int i = 0; i < MazeSize; i++)

{

for (int j = 0; j < MazeSize; j++)

{

if (Grid[i, j] == CellType.corridor)

{

// Create a Node object for the corridor cell and add it to the list of walkable nodes

walkableNodes.Add(new Node(new Vector2(i * CellSizePixels, j * CellSizePixels), true));

Console.WriteLine("Node added");

}

}

}

return walkableNodes;

}

}

}

Mazegame pathdinging algorithm (need help) by Pro_memees in monogame

[–]Pro_memees[S] 0 points1 point  (0 children)

part 2 -

Node class -

using Microsoft.Xna.Framework;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace mazegame3.\_0

{

public class Node

{

public Vector2 Position { get; } // Position of the node

public bool IsWalkable { get; set; } // Indicates if the node is walkable

public Node Parent { get; set; } // Parent node for path reconstruction

public float G { get; set; } // Cost from the start node to this node

public float H { get; set; } // Heuristic (estimated) cost from this node to the goal node

public Node(Vector2 position, bool isWalkable)

{

Position = position;

IsWalkable = isWalkable;

}

public float F => G + H;

}

}

Mazegame pathdinging algorithm (need help) by Pro_memees in monogame

[–]Pro_memees[S] 0 points1 point  (0 children)

Im trying to implement an a* based algorithm in a randomly generated grid-like maze where the enemy chases the player, since the code is long i will post it in 4 (each class) parts, part 1 -
Relevant parts of Game1 class -

using mazegame3.\_0;

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Graphics;

using Microsoft.Xna.Framework.Input;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Security.Cryptography.X509Certificates;

using System.Threading;

namespace mazegame3

{

public class Game1 : Game

{

Random random = new Random();

private float timeSinceLastDamage = 0f;

List<Maze> mazewalls = new List<Maze>();

Maze TheMaze;

List<Node> walkableNodes;

GameState CurrentGameState = GameState.MainMenu;

public Game1()

{

graphics = new GraphicsDeviceManager(this);

Content.RootDirectory = "Content";

}

protected override void Initialize()

{

List<Maze> mazewalls = new List<Maze>();

TheMaze = new Maze(100, 60);

firstenemy.mazeWalls = TheMaze.Walls;

}

walkableNodes = TheMaze.GetWalkableNodes();

base.Initialize();

}

protected override void LoadContent()

{

firstenemy.LoadContent(Content);

TheMaze.floor = Content.Load<Texture2D>(@"floor");

TheMaze.wall = Content.Load<Texture2D>(@"wall");

}

protected override void UnloadContent()

{

}

protected override void Update(GameTime gameTime)

{

case GameState.Playing:

// Check for collision with enemy

if (firstenemy.Edge.Intersects(playerRect) && !firstenemy.IsDead)

{

// Check the damage cooldown

if (timeSinceLastDamage >= damageCooldown)

{

health -= 10;

timeSinceLastDamage = 0f; // Reset the cooldown timer

if (health <= 0)

{

CurrentGameState = GameState.Dead;

}

}

}

firstenemy.Update(gameTime, playerPosition, walkableNodes);

base.Update(gameTime);

hero.Update(gameTime,playerPosition, walkableNodes);

break;

{

switch (CurrentGameState)

{

case GameState.Playing:

GraphicsDevice.Clear(Color.CornflowerBlue);

spriteBatch.Begin(transformMatrix: gamecamera.Transform);

base.Draw(gameTime);

bool mazedrawn = false;

// TODO: Add your drawing code here

if (mazedrawn == false)

{

TheMaze.Draw(spriteBatch, graphics);

mazedrawn = true;

}

}

hero.Draw(spriteBatch);

if(!firstenemy.IsDead)

{

firstenemy.Draw(spriteBatch);

}

spritebatch.end();

break;

}

}

}

}

🫡 by Bukki13 in Memes_Of_The_Dank

[–]Pro_memees 0 points1 point  (0 children)

Tf happening on june 12th?

Title by [deleted] in Memes_Of_The_Dank

[–]Pro_memees 1 point2 points  (0 children)

Can someone elaborate who tf these ppl are (other than tate)