Find Jobs
Hire Freelancers

Dave database

$10-30 USD

Complété
Publié il y a plus de 9 ans

$10-30 USD

Payé lors de la livraison
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.
N° de projet : 6375072

Concernant le projet

1 proposition
Projet à distance
Actif à il y a 10 ans

Cherchez-vous à gagner de l'argent ?

Avantages de faire une offre sur Freelancer

Fixez votre budget et vos délais
Soyez payé pour votre travail
Surlignez votre proposition
Il est gratuit de s'inscrire et de faire des offres sur des travaux
Décerné à :
Avatar de l'utilisateur
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 jour
0,0 (0 commentaires)
0,0
0,0

À propos du client

Drapeau de UNITED STATES
dallas, United States
5,0
21
Méthode de paiement vérifiée
Membre depuis sept. 11, 2013

Vérification du client

Merci ! Nous vous avons envoyé un lien par e-mail afin de réclamer votre crédit gratuit.
Une erreur a eu lieu lors de l'envoi de votre e-mail. Veuillez réessayer.
Utilisateurs enregistrés Total des travaux publiés
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Chargement de l'aperçu
Permission donnée pour la géolocalisation.
Votre session de connexion a expiré et vous avez été déconnecté. Veuillez vous connecter à nouveau.