Find Jobs
Hire Freelancers

Dave database

$10-30 USD

Terminado
Publicado hace más de 9 años

$10-30 USD

Pagado a la entrega
You are working on a 2D game called “It’s A Trap!” In the level editor, your designers place traps on the map which apply special effects to any player while the player stands on them. Traps come in two basic shapes: circles and squares. Additionally, some traps are good (have beneficial effects) and some traps are evil (have harmful effects). Any given trap may contain good effects or evil effects, but not both. If a player is standing in the area of two traps overlapping, the effects of both traps are applied to the player. Because each good effect cancels out a corresponding evil effect, you need to generate a report so that designers can detect these situations and adjust their trap placement. 1. Parse the provided trap database (.trp) file per the provided file format specification. 2. Detect all pairs of traps that have both overlapping areas and conflicting effects. 3. Write to the output console (or .txt file) the list of conflicting trap pairs you detected in step 2. Note: Two traps are overlapping if the area of intersection of their physical geometry is > 0. This means that two traps can touch but not be overlapping. What effects conflict with one another? • Healing (good) conflicts with Poison (evil) • Strength (good) conflicts with Weakness (evil) • Bravery (good) conflicts with Fear (evil)   Trap Database File Format File Offset (in Bytes) Value Type Value Description 0 Unsigned Integer (32 bits) Number of traps (N) in the file. 4 Trap Information (80 bytes; see below) Trap 0 84 Trap Information (80 bytes; see below) Trap 1 … … … 4 + (80 * N) Trap Information (80 bytes; see below) Trap N Trap Information Offset (in Bytes) Value Type Value Description 0 Unsigned Byte (8 bits) Shape Type: 0 – Circle, 1 – Square 1 Unsigned Integer (32 bits) Unique ID 5 Unsigned Byte (8 bits) Effects Flags 6 Signed Integer (32 bits) Center X Coordinate 10 Signed Integer (32 bits) Center Y Coordinate 14 char[62] (62 x 8 bits) Trap Name (ascii characters) 76 Signed Integer (32 bits) Radius (circle), Half-extent (square) Effect Flags Bit Value Bit 0 (1 << 0) Trap ‘alignment’ flag. 1 = good trap. (Bits 1-3 represent good effects) 0 = evil trap. (Bits 1-3 represent evil effects) Bit 1 (1 << 1) Healing or Poison flag (depends on alignment) Bit 2 (1 << 2) Strength or Weakness flag (depends on alignment) Bit 3 (1 << 3) Bravery or Fear flag (depends on alignment) Bits 4-7 Reserved Terminology: Number of traps in database: This value gives the total number of traps stored in the database file. Shape Type: The type of shape the current trap is. 0: Circle. 1: Square. Squares are axis- aligned. That is, each edge is parallel to the X or Y axis. Unique ID: Each trap has a unique identifier. This value is guaranteed to be unique for each trap, across the database of traps within the trap database file. Trap Name: Each trap has a name, this null terminated string represents the name. It is not guaranteed to be unique. Effect Flags: Each trap has an Effect Flags value. Bit 0 represents whether or not the trap is good or evil (good = 1, evil = 0). Bits 1-3 represent the effects which are enabled for that trap. Center X: The X coordinate of the center point of the trap. Center Y: The Y coordinate of the center point of the trap. Half-Extent: For Square traps, the Half-Extent represents half the length of one side of the square, which also happens to be the distance from the center point to an edge. Radius: For Circle traps, the Radius is the distance from the center point to the edge of the Circle.
ID del proyecto: 6375072

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hello, I would like to do this project for you. I can write a simple program that would check for overlapping traps with opposite effects and generate a text file listing the conflicting pairs.
$10 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
dallas, United States
5,0
21
Forma de pago verificada
Miembro desde sept 11, 2013

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.