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:
- Download program, source, LDD model and resources
- Extract the zip file (check this if you need help)
Buliding the model:
- If you don’t have LEGO Digital Designer, download and install it.
- Double click the duel.lxf file in the folder you have extracted.
- 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:
- Turn on your NXT and connect it to your PC using the USB cable.
- Open the LEGO MINDSTORMS NXT sofware.
- Near “Create new program”, click “Go >>”.
- Open the NXT window (click the upper left button above the “Play” button.
- Click on the “memory” tab.
- 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).
- In your NXT, go to “My Files”, “Software Files”, then “Duel”.
- 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.
Buenas noches!
Me gustaria informate que al compilar el archivo Duel.nxc con Bricx Command Center no funcionan bien los tiempos.
Hi Fernando!
What is exactly wrong with the timings? What happens?
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);
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.
my motor on the left constantly goes when left loses and i cant find the program in nxt 2.1
How does it stand up? The base is really flexible. And, the instructions are impossible to understand! *MAD!*
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 🙂
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
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.
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.
very cool made it
but can u tell me how to put the files on the nxt so i can play with it
thanks
Open the Memory tab of the NXT window (the upper left button besides the “Play” button) and click Download.
I cannot get the memory tab to give me the download option. Please tell me what I am doing wrong.
Did you find the button, but it’s disabled? Are you sure the NXT is connected?
I found the button and it was grayed out therefore not an option. I am not really good at this. Is the NXT the programming box?:/
Yes, the NXT box needs to be turned on and connected to the PC using the USB cable.
where are the building instructions? I can not find names and I really want it done because he looks very nice Thanks
Open the LXF file in Lego Digital Designer and press F7.
okay thank you but where can I find lxf file and how can I open it and where can I open it??
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.
Thank you and where is the program I need it for?
http://ldd.lego.com/
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?
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.
i dont understand how you get all those files from the zip file to the mindstorm program itself.
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.
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?
That’s too bad! I will try to double check the program to see if it’s OK.
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?
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.
Oops, you’re right! Thanks!
how do you open the program? Is on the Mindstorm program things?
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.
Thanks but i alreay firgured it out
Have you the programme in C or C++?
Yes, it’s included in the zip. It’s the .nxc file.
But it is the .nxc file, I mean “.c fil”.
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.
Can you make a pdf document instructions?
Are you having trouble generating the instructions, or did you not like the instructions generated by LDD?
on the tool bar in lego digital designer, it lets you make an html version of it which is basically a pdf
look very kewl… seen lots of youtube videos about it… cant wait to try it out
-D
wait. so you download every file to the nxt except for the one that goes on the lego digital designer?
Exactly.
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
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.
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!
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 🙂
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?
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).
hi i made your game.
however, i can’t get the program. where is the play button
can you help me>
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?
I view something really interesting about your blog so I saved to favorites .
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 ?
Great project.
Everything was working well. My high score was 12 times
i can’t download the program please help?
You can’t download the program to your PC or you can’t download the program to the NXT? What is happening?
i already got the program but the nxt doesn’t schow anything on the screen
btw its show but i cant see anything on the screen
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
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
This is awesome. I am very glad you both liked it!
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
te agradecería sobretodo el plano de como conectar los cables
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!!!!
The sound files are .rso files which are included in the download.
that is not the Problem, the brickcc Sound Editor dosn’t work.
where can I find a Sound Editor for NXC???
There is one in the default LEGO NXT Mindstorms software.
sorry, I have found it
but ”bell.rso” dosn’t work
but how do you get those files on your nxt
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
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.
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!!!!!!!!!
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. :/
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.
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.
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
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
also, how do you get it where the crow sound are random?
maybe take like a picture of your program?
It’s not written in the default NXT visual programming, it’s written in NXC.
whats NXC?
It’s an alternative programming language for the NXT:
http://bricxcc.sourceforge.net/nbc/
ok, i got the thing. my NXT it connected to it. i opened Duel in it and well….its not as readable as i thought it would be to put into the defualt NXT programming
Yes, there is a learning curve… but after you learn it you can do many stuff that would be very hard to program in the default programming language. There is a NXC manual and many tutorials around the net. 🙂
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
Have you normal instruction? Not 3D model?
That is why it is a lack of experience behind them still feel that you do not submit to investigation search
engine marketing engines.
My web site marketing en internet
Hey:)
Could you send me a screenshot of the program? I`m not able to open it…:/
Thx in advance
Dan
Hello Conrado!
First of all, congrats on the project, the design, it is really amazing. Also, lots of thanks for sharing your building instruction, code and your detailed description on everything. My friend and I made it with ease thanks to your detailed instructions.
I do have a question for you, maybe I am blunt for asking it, but I’m gonna go with it. We wanted to play a little with the code, make some changes, but it seems like even the smallest change to it makes the project crash. Confused, we then tried testing it like renaming just a method or so, it still would crash. We then tried to just eliminate the single player mode, it crashed. I am saying all this so you know it is not that we have written a new code that doesn’t work, to make it clear what I am asking. We never coded in Bricx Command Center, so we are a little unfamiliar with it. So, we make this small changes to the code, compile it and then download it to the nxt device, and then try to run it. We did not erase any of the other files. Is it possible that somehow the NXT platform has hard-coded the previous version of the Duel.nxc?
Sorry for the long post, but we could really use some help with this. Thanks a lot!
Emina
Is there any chance I get this program on .ev3 language?
I dont have the NXT kit. I use the EV3.
I made this using your instructions and it works perfectly!!! Can’t wait to have a showdown in class.
Thanks so much for making this available!
sound is not working
nothing is shown on the screen
Hey guys , I had a problem with the sensor / motor ports
if you also had a problem the correct connections that worked for me are
Right (hand side) motor : Port C
Left (hand side) motor : Port B
Clock : Port A
Right (hand side) gun : Port 2
Left (hand side) gun: Port 1