This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is run just before the game "scenario" is printed on the screen | |
@Override | |
protected void updateGame(float secondsElapsed) { | |
float distanceBetweenBallAndPaddle; | |
float distanceBetweenBallAndSmiley; | |
if (mBallSpeedY > 0){ // If the ball is moving down the screen do this block | |
// Removed ball speed calculations to after the "if ball hits paddle" code | |
// Only need to change the speed/direction if a hit is detected. Otherwise leave it alone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # This is a copy of my current code at then end of week 3 | |
// # You can download some instructions and the sound files I used in a zip file from | |
// # http://www.robsbots.org.uk/files/mooc/sounds.zip | |
// # You will need to extract the contents into a folder on your computer, | |
// # then open the instructions.txt file to explain how to enable sound. | |
// # | |
package uk.ac.reading.sis05kol.mooc; | |
//Other parts of the android libraries that we use | |
import android.graphics.Bitmap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This starts a "multi line comment | |
This ends a multi line comment */ | |
/* Anything within a comment is ignored so you can put what ever you like in a comment. | |
This can go on for line after line. | |
The last line should finish with */ | |
/* This can be very handy when writing software. | |
If you write a new piece of code, you can put comments around the old piece and test out a new part | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
################################################################################################ | |
# #FLMobiGame FutureLearn Begin Programming # | |
# End of week 4 code # | |
# # | |
# Sound added with the use of the SoundPool library # | |
################################################################################################ | |
*/ | |
package uk.ac.reading.sis05kol.mooc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uk.ac.reading.sis05kol.mooc; | |
//Other parts of the android libraries that we use | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.media.MediaPlayer; | |
public class TheGame extends GameThread{ | |
//Will store the image of a ball | |
private Bitmap mBall; | |
//The X and Y position of the ball on the screen (middle of ball) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uk.ac.reading.sis05kol.mooc; | |
//Other parts of the android libraries that we use | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.media.AudioManager; | |
import android.media.SoundPool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uk.ac.reading.sis05kol.mooc; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.os.Bundle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<uk.ac.reading.sis05kol.mooc.GameView | |
android:id="@+id/gamearea" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"/> | |
<RelativeLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
* odd_func.c | |
* | |
* Strange function definition test | |
* | |
* Can you define one function inside another and have it compile ? | |
* Apparently you can. | |
* We can have local functions....... | |
* Neither of these local function can be called from outside their scope. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File name:- server_config.php | |
// Configuration settings for Mail server | |
define('SMTP_SERVER', 'smtp.gmail.com'); | |
define('SMTP_PORT', 587); | |
define('SMTP_USERNAME', 'your_gmail_user_name'); | |
define('SMTP_PASSWORD', 'your_gmail_password'); | |
define('SMTP_AUTH', true); | |
define('SMTP_AUTH_TYPE', 'tls'); |
OlderNewer