Skip to content

Instantly share code, notes, and snippets.

private boolean isWin() {
if (topLeft == left && left == bottomLeft && bottomLeft == nowUser) {
return true;
} else if (top == center && center == bottom && bottom == nowUser) {
return true;
} else if (topRight == right && right == bottomRight
&& bottomRight == nowUser) {
return true;
} else if (topLeft == top && top == topRight && topRight == nowUser) {
return true;
package com.me.mygdxgame;
import java.util.ArrayList;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
boolean canPut(float x, float y){
if(25<x && x<=120){
//x左邊
if(130<y && y<=225){
//y上方
if(topLeft==0){
//沒有放過旗子
topLeft =1;
return true;
}
@Override
public void render() {
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined);
batch.begin();
float x = sprite.getX();
x+=0.005f;
sprite.setX(x);
int battleTime = 0;
for(;;){
battle (slime*2);
battleTime=battleTime+1;
if (battleTime==1)
{
printf("打玩一場戰鬥還剩下四場");
}
int battleTime=0,slime=2,cake;
for(;;)
{
battle(slime);
battleTime++;
if(battleTime==1)
{
printf("打完一場戰鬥,還剩下四場");
}
else if(battleTime==2)
int battle=0;
for(battle=1;battle<=5;battle++)
{
battle(slime, 2);
switch(battle)
{
case 1:printf("打完一場戰鬥還剩下4場\n");break;
case 2:printf("打完一場戰鬥還剩下3場\n");break;
case 3:printf("ㄚㄚ#\n");break;
case 4:printf("4\n");break;
@housemeow
housemeow / text
Last active December 24, 2015 15:59
變量操作 battleTime = 0;
循環
戰鬥處理 slime*2
如果 便量battleTime==1
顯示文字 打文一場戰鬥還剩下四場
否則
如果便量 battleTime==2
打完二場戰鬥!還剩下三場
否則
如果便量 battleTime==3
printf("想吃蛋糕嗎?);
int input;
scanf("%d", &input);
if(input==1){
getItem("Cake", 5);
}else{
printf("敬酒不吃 罰酒");
battle();
}
//輸出cost
double getTypeACost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
double getTypeBCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
double getTypeCCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
double getTypeDCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
double getTypeECost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
//輸出真正花費(cost低於資費時,還是得花資費的錢)
double getTypeARealCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);
double getTypeBRealCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS);