Hunting Game: Progress Report

 

Jin Zhang(3161758) & Siyue Liang(3165618)

Inspiration

In our previous projects, we paid more attention to the visual effects aspect. Most of our projects are a bit weak in terms of interactivity. For this final project, we decided to explore more on the physical interactions. We want to build a shooting game by using physical materials and make it realistic. Our idea is to create a shooting theme related game where the player uses a laser pointer / a toy gun to aim for the center of the targets.

 

Contextual Work

The duck hunting game:

https://www.youtube.com/watch?v=YyM6MmBM14w

 

A light sensor would be placed in the center of the target and a servo motor is attached to the base of the target.  When the player put the pointer to the center, the target would fall flat. Some of the details still need to be refined and we are still in the testing phase.

 

Materials & Techniques

  • Light sensors/pressure sensors
  • Servo motors
  • Light pointers/laser light
  • Cardboards and aluminum foil

 

Since our idea for this project is pretty different from what we did for previous projects, we might not be using any same materials or techniques as before. We are still thinking what kind of sensor should we use as switches in this game.

 

Code & Wiring

 

#include <Servo.h>

Servo servo1;

int forcevalue = analogRead(A0);   

int pos1 = 90;

 

void setup() {

Serial.begin(9600);   

servo1.attach(9); //servo at digital pin 9

//servo.write(0); //initial point for servo

 

}

 

void loop() {

 forcevalue = analogRead(A0); //attached to analog 0

 Serial.print(“Sensor value = “);

 Serial.println(forcevalue);

 

 //int value = map(reading, 0, 1023, 0, 255);

 if (forcevalue = 100){

 for (pos1 = 90; pos1 <= 180; pos1 += 30) {

 servo1.write(pos1);

 delay(1);  

 }

}

}

%e5%b1%8f%e5%b9%95%e5%bf%ab%e7%85%a7-2018-11-26-%e4%b8%8b%e5%8d%886-18-53

Work in Progress

wechatimg4015

wechatimg4017

The sensor works as a switch to control the servo motor and sound.

wechatimg4019

wechatimg4021

The value of the sensor would go from 0 and suddenly to 1023 for some reasons.  We were confused and figured that there might be something wrong with the wiring or the code.  We are still testing it and trying to find a solution for this issue.

Leave a Reply