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
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/
Diff: blob.cpp
- Revision:
- 0:9d6ea88b6d14
- Child:
- 1:e487713a5231
diff -r 000000000000 -r 9d6ea88b6d14 blob.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blob.cpp Sun Mar 20 03:38:40 2016 +0000 @@ -0,0 +1,44 @@ +#include "blob.h" +#include "mbed.h" + +extern Serial pc; + + +// Randomly initialize a blob's position, velocity, color, radius, etc. +// Set the valid flag to true and the delete_now flag to false. +// delete_now is basically the derivative of valid. It goes true for one +// fram when the blob is deleted, and then it is reset to false in the next frame +// when that blob is deleted. +void BLOB_init(BLOB* b) { + // *** +} + + +// Take in a blob and determine whether it is inside the world. +// If the blob has escaped the world, put it back on the edge +// of the world and negate its velocity so that it bounces off +// the boundary. Use WORLD_WIDTH and WORLD_HEIGHT defined in "misc.h" +void BLOB_constrain2world(BLOB* b) { + // *** +} + +// Randomly initialize a blob. Then set the radius to the provided value. +void BLOB_init(BLOB* b, int rad) { + // *** +} + +// Randomly initialize a blob. Then set the radius and color to the +// provided values. +void BLOB_init(BLOB* b, int rad, int color) { + // *** +} + +// For debug purposes, you can use this to print a blob's properties to your computer's serial monitor. +void BLOB_print(BLOB b) { + pc.printf("(%f, %f) <%f, %f> Color: 0x%x\n", b.posx, b.posy, b.vx, b.vy, b.color); +} + +// Return the square of the distance from b1 to b2 +float BLOB_dist2(BLOB b1, BLOB b2) { + // *** +} \ No newline at end of file