My tile map renders sideways or mirrored

It compiled and it is still wrong

My tile map renders sideways or mirrored

This page is part of Intro to Java with Greenfoot. It assumes you have reached lesson 6.2. Opening it is not counted against you and is not tracked as progress.

What it actually means

The row and column indexes are swapped somewhere, so the grid renders transposed.

The usual causes

Ranked by how often each one turns out to be the answer. Work down the list.

  1. addObject is being called with row and col the wrong way round. The world wants x first, and x is the COLUMN.
  2. The array is being read as map[col][row] instead of map[row][col].
  3. The world is sized with rows as the width instead of columns.

How to fix it

Check three places in order: the array read is map[row][col], the placement is addObject(a, col, row), and the world is super(map[0].length, map.length, cell). Then test with a map that is NOT square, because a square map hides this bug completely.

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]