Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Drop The Flag Help!

Sorry for late response, was at school, but i tried on Safari newest version. I’ll try on firefox.

Ok, so i tried on firefox, says "Uh oh! your browser is to old to run this software."
I’ve tried all my computers and it does the same thing every time. only browser that i have that works for code combat is Safari on my Mac Book Pro.

The problem is the location should be iitemx = item.pos.x and itemy = itemy.pos.y

trying it now. but just restating the problem is that the flags arn’t moving my character. Still will trying though.

Didn’t do anything, tbh it just changed the name of the item. The original was fine i’m just getting a error when i place the flag it just freezes my character and gives me a error message "

The Safari version you are talking about, is version 8, or 7.1, or 6.2…?

I believe 8, but let me double check.

Yep, it is 8.0 safari.

Hmm, I still can’t reproduce the bug even with the same browser and code. Were you able to place flags successfully in Coinucopia?

IGNORE THIS TOPIC PLEASE, I HAVE FOUND IT OUT! I PULLED A IDIOT MISAKE AND FORGOT TO EQUIP HAMMER (lol)

You are not alone, I have made similar mistakes more than once. :smile:

That’s what i did. you did it same as me and i won. just place the flag where you want to put the fire trap, and it builds it.

  if flag:
      # How do we get fx and fy from the flag's pos?
      # (Look below at how to get x and y from items.)
      self.buildXY("fire-trap", 30, 45)
      self.buildXY("fire-trap", 30, 31)
      self.buildXY("fire-trap", 30, 16)
  else:
      item = self.findNearestItem()
      if item:
          itemPos = item.pos
          itemX = itemPos.x
          itemY = itemPos.y
          self.moveXY(itemX, itemY)```

need help thats my code that doesn’t work like all the other codes i right :disappointed:

Well, for starters you did not do what the instructions told you…
"(Look below at how to get x and y from items.)"

“Seconders”, you are building 3 firetraps for every flag placed.

Change the code so that you build the fire-trap where the flag is, using the template for “item” (iow: try copying the item code and replacing “item” with “flag”…)

and for “thirders” (snicker at self) learn how to use ``` to format your code so we can see if your indenting is correct.
```
code
```
comes out

    code

(and yes I put four spaces in front of both "code"s)

My hero keeps on dieing from his own fire

Is this posted correct???
loop:

````if flag:
````````# How do we get fx and fy from the flag's pos?
````````# (Look below at how to get x and y from items.)
````````self.buildXY("fire-trap", 30, 45)
````````self.buildXY("fire-trap", 30, 31)
````````self.buildXY("fire-trap", 30, 16)
````else:
````````item = self.findNearestItem()
````````if flag:
````````````itemPos = item.pos
            itemX = itemPos.x
            itemY = itemPos.y
            self.moveXY(itemX, itemY)

If it doesn’t come out right, edit your post until you are following directions…

The directions were:
```
code
```

not:
```code

Then follow the directions on what to change IN the code and it should work (or at least work better) then we’ll see what easy is happening.

alright have a nice week end can you guys help me on monday

Closed Duplicate topic. Please continue the discussion in this thread.