jessprogramminginc

 

Post-Botball

Page history last edited by Jes Stayton 1 yr ago

Post-Botball

 

beep for green after interim

#use "xbccamlib.ic"

int x_val;//enters x and y coordinates of the color

int y_val;

 

int col_mod=2;//change this number to the color you want

void main ()

{

while(!b_button()) // loop until b button pressed

{

 

track_update();//updates image

x_val=track_x(col_mod, 2);

y_val=track_y(col_mod, 2);

track_update();//updates image

if (x_val!=0)

{

beep();

sleep(2.00);

}

ao ();

}

}

 

 

beep for green

#use "xbccamlib.ic"

void main ()

{

int x_val;//enters x and y coordinates of the color

int y_val;

int col_mod=2;//change this number to the color you want

track_update();//updates image

x_val=track_x(col_mod, 2);

y_val=track_y(col_mod, 2);

track_update();//updates image

if (x_val!=0)

{

beep();

sleep(2.00);

}

ao ();

}

 

stop if button is pressed

void main ()

{

motor (1,100);

motor (2,100);

sleep (2.0);

if (digital (8) == 1)

{

motor (1,-100);

motor (2,100);

sleep (1.0);

}

ao ();

}

 

play a song and bounce off the walls if you see green

#use "xbccamlib.ic"

#include "botball.ic"

float a=880.00; //frequency for note A

float g=783.99; //frequency for note G

float e=659.26; //frequency for note E

float a_sharp=932.33; //frequency for note A#

int x_val;//enters x and y coordinates of the color

int y_val;

int col_mod=2;//change this number to the color you want

void main ()

{

while(!b_button()) // loop until b button pressed

{

track_update();//updates image

x_val=track_x(col_mod, 2);

y_val=track_y(col_mod, 2);

track_update();//updates image

if (x_val!=0)

{

start();//calls main function to start running robot

void start()//function to start robot running

{

tone(e,0.5); //start playing "Smoke on the Water"

tone(g,0.5);

tone(a,0.7);

tone(e,0.5);

tone(g,0.5);

tone(a_sharp,0.25);

tone(a,0.7);

tone(e,0.5);

tone(g,0.5);

tone(a,0.7);

tone(g,0.5);

tone(e,1.0);//end playing "Smoke on the Water"

motor(1,100); //run motor in port 1 forward

motor(2,100); //run motor in port 2 forward

}

}

 

//following loop has robot react if sensors are touched

while(1)

{

if(digital(8) ==1)//if sensor in port 8 is touched...

{

front_sensor();//calls front_sensor

}

if(digital(12) ==1)//if sensor in port 12 is touched...

{

back_sensor();//calls back_sensor

}

}

void front_sensor()//function, if front sensor is hit

{

motor(1,-100);//run motor in port 1 backward

motor(2,-100);//run motor in port 2 backward

sleep(1.0);//pause, calibrate

motor(1,-100);//run motor in port 1 backward

motor(2,100);//run motor in port 2 forward at same time, making robot turn

sleep(1.5);//pause, calibrate

motor(1,100);//run motor in port 1 forward

motor(2,100);//run motor in port 2 forward

}

void back_sensor()//function, if back sensor is hit

{

motor(1,100);//run motor in port 1 forward

motor(2,100);//run motor in port 2 forward

sleep(1.0);//pause, calibrate

motor(1,100);//run motor in port 1 forward

motor(2,-100);//run motor in port 2 backward at same time, making robot turn

sleep(1.5);//pause, calibrate

motor(1,100);//run motor in port 1 forward

motor(2,100);//run motor in port 2 forward

}

}

}

 

Video Games

Some things that are good in a video game are when the

game is well-made, as in the graphics are good, the character

moves smoothly and quickly and the sounds sound right for the

game. I think that an interesting plot line is important, and

that the the game changes or gets harder as you go along. One

thing I in particular like is if you can choose a female

character and if she is just as good as the male character. I

also like little secret places/things that you can see/get if

you investigate a little, and little programming glitches where

something will happen that is not supposed to happen and it's

very funny.

Some things that are bad in a video game are long scenes

where you cannot do anything, or controls that are difficult to

use. i also do not like parts that are frustratingly hard, or

it is hard to figure out what you are supposed to be doing. I

also do not like it when you are stuck in a small area or

forced to do something you do not want to do.

 

Green blob and Fish game

I made this game because I wanted something easy to draw

and modify, like a fish. I picked this premise because I

wanted to do a real picture for a background, and because I

wanted to mess with making the sprites move, without worrying

about gravity. It is also fun to have one Sprite chase the

other. I made it a two-player game because I think that would

be more fun.

The objective of this game is simple: you want to have the

highest score. For the fish, this means catching and eating

the green blob quickly. For the green blob: this means

escaping being eaten for as long as you can.

The way for the fish to move is:

right arrow : go right

left arrow : go left

up arrow : go up

down arrow : go down

green flag : start the game

red stop sign : stop the game

a : try again(without restarting game)

The way for the green blob to move is:

q : go right

w : go left

e : go up

r : go down

green flag : start the game

red stop sign : stop the game

a : try again(without restarting game)

 

Have fun!

Comments (0)

You don't have permission to comment on this page.