LEGO NXT Duel

The NXT Duel is a game that tests your reflexes, entirely built with a NXT 2.0 kit. Play against other person, or play by yourself beating the computer challenges.

How to play

Whoever shoots first after the bell rings wins. Watch out for distractions, like the crows squawking — if you shoot too early, you’ll lose.

During the round, an orange flag will rise. Its purpose is to create tension since the bell is guaranteed to ring sometime before it fully rises.

Single player mode

In single player mode, you’ll need to beat the 9 computer challenges: after the bell rings, you must shoot within the number of milliseconds specified in the round. In the first round, you’ll have 500 ms — that’s actually plenty of time! In the last challenge, though, you’ll be at the edge of standard human reflex times :)

The record number of tries that you take to complete all challenges is recorded. Can you do it in only 9 rounds, without a single miss?

In this mode, use the gun with the grey handle.

Two player mode

It’s simple: whoever shoots first, wins! You can select the number of rounds you need to win in order to win the game. The response time of the round winner is shown on the screen.

Instruction and Program

First, get everything you need:

  1. Download program, source, LDD model and resources
  2. Extract the zip file (check this if you need help)

Buliding the model:

  1. If you don’t have LEGO Digital Designer, download and install it.
  2. Double click the duel.lxf file in the folder you have extracted.
  3. After the file opens in LEGO Digital Designer, press F7 and follow the instructions to build the model.

Downloading the program and files to the NXT:

  1. Turn on your NXT and connect it to your PC using the USB cable.
  2. Open the LEGO MINDSTORMS NXT sofware.
  3. Near “Create new program”, click “Go >>”.
  4. Open the NXT window (click the upper left button above the “Play” button.
  5. Click on the “memory” tab.
  6. Click “Download”. Go to folder you have extracted in Step 2, select the first file and Click OK. Click “Download” again, select the second file, click OK, and so on for all files (sorry, I don’t know any easier way to do this).
  7. In your NXT, go to “My Files”, “Software Files”, then “Duel”.
  8. Play!

The program is coded in NXC, you can use the Bricx Command Center if you want to make changes to the code.

Fun Facts About Reaction Time

There is some interesting research on reaction time; check this literature review. Some highlights:

  • Reaction time for sound stimuli is smaller than for visual stimuli; 160 ms vs 190 ms on average. (These are simple reaction times. Since there are distractions in the NXT Duel, your response time will be slower.)
  • Your reaction time get worse if you’re too relaxed or too tense.
  • Your reaction time is faster during expiration.
  • Your reaction time is faster with your left hand if you are right-handed, and vice-versa.
This entry was posted in NXT and tagged , , . Bookmark the permalink.

90 Responses to LEGO NXT Duel

  1. Fernando says:

    Buenas noches!
    Me gustaria informate que al compilar el archivo Duel.nxc con Bricx Command Center no funcionan bien los tiempos.

  2. Fernando says:

    El problema es que a la variable end_time no se suma la variable CurrentTick() si lo pones de la siguiente manera:

    long end_time = CurrentTick() + 2000 + rnd + Random(1000);

    Para solucionar el problema debemos de poner:

    long end_time;
    end_time = CurrentTick() + 2000 + rnd + Random(1000);

    • Conrado says:

      I think you may be using a older version of Bricx/NXC, try updating it :)

      But thanks for report, other people might have the same issue.

  3. EpicChicken says:

    How does it stand up? The base is really flexible. And, the instructions are impossible to understand! *MAD!*

    • Conrado says:

      I’m not sure what you mean, the base is somewhat flexible, but it held itself fine on a flat surface.

      Sorry for the instructions, LDD instructions are not so good. I’ll try to make my own next time.

      But I suggest that you use your creativity, the basic structure is very simple (just motors with axles attached). Most of the model is just decorations, so you can come up with your own :)

  4. Anonymous says:

    Can you please make better instructions for this particular robot. I really want to build it but the LDD instructions are horrible. Please post this ASAP.

    Thanks

    • Conrado says:

      Sorry, I’ve already disassembled it. But it is very simple, you can make your own — it doesn’t have to be exactly the same to work.

    • Avery says:

      i made one at school in robotics. it only took two hours and programing was simple. im only twelve and have only porgramed a robot to move foreward before i programed the game.

  5. vin says:

    very cool made it
    but can u tell me how to put the files on the nxt so i can play with it
    thanks

  6. yorick says:

    where are the building instructions? I can not find names and I really want it done because he looks very nice Thanks

  7. yorick says:

    okay thank you but where can I find lxf file and how can I open it and where can I open it??

    • Conrado says:

      Click on the “Download program, source, LDD model and resources” link in the post. Extract the zip file. Install LDD. Double click the extracted lxf file.

  8. yorick says:

    Thank you and where is the program I need it for?

  9. parney says:

    Conrado….I cannot get the flag to rotate properly. It doesnt rotate like on your video it just sits there and i have to manually push it down to get the next shot to work. Is your program faulty? can you take a look at it and let me know?

    • Conrado says:

      I’m sorry, I don’t know what is wrong, the program worked fine for me. Try exchanging motors and cables and see if it persists.

  10. mario says:

    i dont understand how you get all those files from the zip file to the mindstorm program itself.

    • Conrado says:

      Extract the zip file.
      Open the Memory tab of the NXT window (the upper left button besides the “Play” button) and click Download. Select the extracted files.

  11. parney says:

    I tried changing the cables and every possible combination but still the flag doesnt rotate like it is supposed to. Anyone else had this problem with the program?

    • Conrado says:

      That’s too bad! I will try to double check the program to see if it’s OK.

    • Conrado says:

      I’ve double checked and everything is fine. If you use batteries, are they fully recharged? Otherwise, it may be a problem in the “A” port of your NXT brick — do other programs work fine?

  12. parney says:

    i think you mean “download” not “upload” don’t you? upload takes programs from the nxt to the pc whereas “download” takes programs from pc and puts it onto the nxt.

  13. mindy says:

    how do you open the program? Is on the Mindstorm program things?

    • Conrado says:

      You can’t open the program in the NXT software since it was coded using another method. But it runs just fine. If you want to edit the code, you will need to learn NXC.

  14. mindy says:

    Thanks but i alreay firgured it out

  15. kaka says:

    Have you the programme in C or C++?

  16. kaka says:

    But it is the .nxc file, I mean “.c fil”.

    • Conrado says:

      The NXC compiler for the NXT, which uses (something like) the C language, uses the .nxc file extension. The source code is in the .nxc file.

  17. Kevin Chung says:

    Can you make a pdf document instructions?

    • Conrado says:

      Are you having trouble generating the instructions, or did you not like the instructions generated by LDD?

    • Jack Lettre says:

      on the tool bar in lego digital designer, it lets you make an html version of it which is basically a pdf

  18. Dee Heart says:

    look very kewl… seen lots of youtube videos about it… cant wait to try it out

    -D

  19. Jack Lettre says:

    wait. so you download every file to the nxt except for the one that goes on the lego digital designer?

  20. Hello says:

    Wow i love the guns! there AMASING!!! how did you come up with the idear? i am going to use them in my next robot!!!! do you have any idears of how i should use them???

    Thank-you

  21. Maurice says:

    Hello,

    It works great.
    Only the building instructions from LDD are not very easy to follow.
    However I would rate it 5 out of 5.

  22. cdub says:

    Conrado, my son and I thank you for a super project. We really appreciate that you took the time to imagine, build, document and share your procedure. We were able to get through the building instructions and where the LDD wasn’t perfectly clear, we adjusted our design to suffice. When we wanted to change the look or details, we used our imagination and did it. Basically, I just wanted to let you know that despite some of the frustrated comments posted here, there are rational people in the world who don’t have to have every trivial thing spelled out to them. I hope you are able to look past the whining and continue to build and share. You are an inspiration to kids like my son!

    • Conrado says:

      Hi! Thank you very much for the kind comment — it makes all worth it.

      Stay tuned, I’ll soon post another project which I think is very fun :)

  23. Anthony says:

    Hi! Awesome robot, but I ran into a problem, I cannot open the .nxc file in the Lego Mindstorms NXT 2.0 software. Is there another way of transferring the program into my NXT Brick or am I just doing it wrong?

    • Conrado says:

      You’re not supposed to open the .nxc file with the NXT software. It was written using NXC; if you want to edit the program, you will need to use Bricx Command Center.

      If you just want to play it, follow the instructions — you just need to download the .rxe file and auxiliar files (i.e. all files except the .lxf and .nxc).

  24. joe says:

    hi i made your game.
    however, i can’t get the program. where is the play button
    can you help me>

  25. bobo says:

    HI really great project
    however i can’t download any of the files
    which one am i suppose to?
    can you reply to this comment with the file that im suppose to download?
    all the files says nxc rxe ric rso and when i tried to change those files to an nxt file, it says there is an error.
    what am i doing wrong?

  26. I view something really interesting about your blog so I saved to favorites .

  27. Sean says:

    Nice project !
    everything was just fine from constructing the robot until downloading the program into my NXT.
    But problem appeared after I press the orange button to run the program, It doesn’t display anything on the screen. I mean my NXT’s screen. It is blank
    May I know what’s the problem ?

  28. Rohith says:

    Great project.
    Everything was working well. My high score was 12 times

  29. help! says:

    i can’t download the program please help?

    • Conrado says:

      You can’t download the program to your PC or you can’t download the program to the NXT? What is happening?

  30. help! says:

    i already got the program but the nxt doesn’t schow anything on the screen

    • help! says:

      btw its show but i cant see anything on the screen

    • Conrado says:

      Make sure you transfer all the files to the NXT:

      Duel.rxe
      reflex_1p.ric
      reflex_2p.ric
      reflex_bell.rso
      reflex_crow.rso
      reflex_d0.ric
      reflex_d1.ric
      reflex_d2.ric
      reflex_d3.ric
      reflex_d4.ric
      reflex_d5.ric
      reflex_d6.ric
      reflex_d7.ric
      reflex_d8.ric
      reflex_d9.ric
      reflex_error.rso
      reflex_gbu.rso
      reflex_gunshot.rso
      reflex_left_w.ric
      reflex_record.ric
      reflex_record2.ric
      reflex_right_w.ric
      reflex_rounds.ric
      reflex_tries.ric

  31. Takahashi(oyasai55) says:

    I saw your website and tried to make Lego. I just want to appreciatet that My child love it. Thank you very much!

    http://www.youtube.com/watch?v=0F2JKZzuCGw

  32. santiago legomaster says:

    mira encontré un problema y es que cuando el jugador gris dispara la bandera no se detiene y la música deja de sonar, en pocas palabras el juego deja de funcionar y te quería pedir el favor de que me mandaras un plano de como conectar los cables, gracias

  33. max musterman says:

    How do I download the Sound and text files on my NXT?
    my Brickcc nead wav Files but there are only ric files. Please help me!!!!

  34. max musterman says:

    that is not the Problem, the brickcc Sound Editor dosn’t work.
    where can I find a Sound Editor for NXC???

  35. max musterman says:

    sorry, I have found it

  36. max musterman says:

    but ”bell.rso” dosn’t work

  37. viktor says:

    but how do you get those files on your nxt

  38. where do i find the program itself? not the building instructions like the thing you put into the NXT programming program. i built my own model and i need to make it where when 1 shoots the other person cant which i cant figure out. please help

    • Conrado says:

      The source code is the Duel.nxc file. I didn’t use the default NXT software to write it; I’ve used the Bricx Command Center using the NXC language. If you just want to read the program, you can open the Duel.nxc file in a text editor (right click, Open with…). If you want to edit the program and run it, you will need Bricx Command Center.

  39. i just wanna know how you got it where the first one who shoots them over rides the second person from shooting. ITS DRIVING ME MAD!!!!!!!!!

    • Conrado says:

      If I recall correctly it should stop the second person from shooting. Is this not happening?

      • what i mean is im not using the instructions. i made my own version of it and idk how to download your program on to mine. i just wanna know how to make it where when 1 shoots it prevents the other from shooting so i can mkae it myself. im not one to follow intruction booklets. :/

        • Conrado says:

          You say you want to download my program, but you also say you want to prevent the other from shooting. Do you want to use my program or are you writing the program yourself?

          • im writing the program myself. but im having a problem getting it where whoever shoots first makes it where the second player cant shoot.

          • Conrado says:

            I see. I can’t give you precise instructions (and you’re not one to follow instructions), but the idea is: when a player shoots, set a variable to 1, and only allow shooting if the variable is 0. After indicating the result, set it back to 0.

  40. idk what that is. can you give me like a list of what to set. i have it set up like this.
    -Wait for touch–motor(the guy falling)–wait: 1 sec–motor: the guy getting up)–image–wait 10 secs-

    i have the image cause i have it where whoever shoots last there image will come up latest which is an arrow pointing towards the other player showing that the other player won. but when players shoot both of the guys fall down which i dont want and i dont want it to make the shooting sound

  41. ok. i found the variable block but idk what i really do with it. like what do i connect it to. pleas try your hardest to put it in word form

  42. also, how do you get it where the crow sound are random?

  43. maybe take like a picture of your program?

  44. ok. i think i got it all. but i cant download the program from NXC to my NXT . i pressed f7 while my NXT was on and plugged in with a USB and i made sure that the computer knows it was plugged in and yet f7 still did nothing

  45. niki4fdgod says:

    Have you normal instruction? Not 3D model?

  46. I’m amazed, I must say. Rarely do I come across a blog that’s both equally educative and interesting,
    and let me tell you, you have hit the nail on the head.
    The issue is something which not enough men and women are speaking
    intelligently about. I am very happy I came across this in my search for something relating to this.

    my web-site :: minecraft bukkit essentials

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>