Find Jobs
Hire Freelancers

Dave database

$10-30 USD

Abgeschlossen
Veröffentlicht vor mehr als 9 Jahren

$10-30 USD

Bezahlt bei Lieferung
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.
Projekt-ID: 6375072

Über das Projekt

1 Vorschlag
Remote Projekt
Aktiv vor 10 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
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 in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von UNITED STATES
dallas, United States
5,0
21
Zahlungsmethode verifiziert
Mitglied seit Sept. 11, 2013

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.