ECE 2035 AgarIO MiniProject

Dependencies:   4DGL-uLCD-SE ECE2035_Agar_Shell EthernetInterface Game_Synchronizer MMA8452 SDFileSystem Sound USBDevice mbed-rtos mbed wave_player

Fork of ECE2035_Agar_Shell by ECE2035 Spring 2015 TA

This program is a MiniProject given in ECE 2035. This is to design and program the multiplayer ethernet based AGAR.IO mbed game. Starting code is given by the instructor to aid student to complete the project. It utilize uLCD, Accelerometer, pushbuttons, sdFileSystem, ethernetBreakoutBoard, speaker in mBED LPC1768. It uses the similar concept to the Game http://agar.io/

Committer:
jford38
Date:
Sun Mar 20 03:38:40 2016 +0000
Revision:
0:9d6ea88b6d14
Child:
1:e487713a5231
Shell code for Spring 2016 Game "Agar.gt"

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jford38 0:9d6ea88b6d14 1 #include "blob.h"
jford38 0:9d6ea88b6d14 2 #include "mbed.h"
jford38 0:9d6ea88b6d14 3
jford38 0:9d6ea88b6d14 4 extern Serial pc;
jford38 0:9d6ea88b6d14 5
jford38 0:9d6ea88b6d14 6
jford38 0:9d6ea88b6d14 7 // Randomly initialize a blob's position, velocity, color, radius, etc.
jford38 0:9d6ea88b6d14 8 // Set the valid flag to true and the delete_now flag to false.
jford38 0:9d6ea88b6d14 9 // delete_now is basically the derivative of valid. It goes true for one
jford38 0:9d6ea88b6d14 10 // fram when the blob is deleted, and then it is reset to false in the next frame
jford38 0:9d6ea88b6d14 11 // when that blob is deleted.
jford38 0:9d6ea88b6d14 12 void BLOB_init(BLOB* b) {
jford38 0:9d6ea88b6d14 13 // ***
jford38 0:9d6ea88b6d14 14 }
jford38 0:9d6ea88b6d14 15
jford38 0:9d6ea88b6d14 16
jford38 0:9d6ea88b6d14 17 // Take in a blob and determine whether it is inside the world.
jford38 0:9d6ea88b6d14 18 // If the blob has escaped the world, put it back on the edge
jford38 0:9d6ea88b6d14 19 // of the world and negate its velocity so that it bounces off
jford38 0:9d6ea88b6d14 20 // the boundary. Use WORLD_WIDTH and WORLD_HEIGHT defined in "misc.h"
jford38 0:9d6ea88b6d14 21 void BLOB_constrain2world(BLOB* b) {
jford38 0:9d6ea88b6d14 22 // ***
jford38 0:9d6ea88b6d14 23 }
jford38 0:9d6ea88b6d14 24
jford38 0:9d6ea88b6d14 25 // Randomly initialize a blob. Then set the radius to the provided value.
jford38 0:9d6ea88b6d14 26 void BLOB_init(BLOB* b, int rad) {
jford38 0:9d6ea88b6d14 27 // ***
jford38 0:9d6ea88b6d14 28 }
jford38 0:9d6ea88b6d14 29
jford38 0:9d6ea88b6d14 30 // Randomly initialize a blob. Then set the radius and color to the
jford38 0:9d6ea88b6d14 31 // provided values.
jford38 0:9d6ea88b6d14 32 void BLOB_init(BLOB* b, int rad, int color) {
jford38 0:9d6ea88b6d14 33 // ***
jford38 0:9d6ea88b6d14 34 }
jford38 0:9d6ea88b6d14 35
jford38 0:9d6ea88b6d14 36 // For debug purposes, you can use this to print a blob's properties to your computer's serial monitor.
jford38 0:9d6ea88b6d14 37 void BLOB_print(BLOB b) {
jford38 0:9d6ea88b6d14 38 pc.printf("(%f, %f) <%f, %f> Color: 0x%x\n", b.posx, b.posy, b.vx, b.vy, b.color);
jford38 0:9d6ea88b6d14 39 }
jford38 0:9d6ea88b6d14 40
jford38 0:9d6ea88b6d14 41 // Return the square of the distance from b1 to b2
jford38 0:9d6ea88b6d14 42 float BLOB_dist2(BLOB b1, BLOB b2) {
jford38 0:9d6ea88b6d14 43 // ***
jford38 0:9d6ea88b6d14 44 }