Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Convert the following java based code to C code: private function hCorridor(x1:Int, x2:Int, y) { for (x in Std.int(Math.min(x1, x2))...Std.int(Math.max(x1, x2)) + 1) { //

Convert the following java based code to C code:

private function hCorridor(x1:Int, x2:Int, y) {

for (x in Std.int(Math.min(x1, x2))...Std.int(Math.max(x1, x2)) + 1) {

// destory the tiles to "carve" out corridor

map[x][y].parent.removeChild(map[x][y]);

// place a new unblocked tile

map[x][y] = new Tile(Tile.DARK_GROUND, false, false);

// add tile as a new game object

addChild(map[x][y]);

// set the location of the tile appropriately

map[x][y].setLoc(x, y);

}

}

// create vertical corridor to connect rooms

private function vCorridor(y1:Int, y2:Int, x) {

for (y in Std.int(Math.min(y1, y2))...Std.int(Math.max(y1, y2)) + 1) {

// destroy the tiles to "carve" out corridor

map[x][y].parent.removeChild(map[x][y]);

// place a new unblocked tile

map[x][y] = new Tile(Tile.DARK_GROUND, false, false);

// add tile as a new game object

addChild(map[x][y]);

// set the location of the tile appropriately

map[x][y].setLoc(x, y);

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago

Question

2. How were various roles filled?

Answered: 1 week ago