Android Open Source - SquareJam Square Color Change Callback






From Project

Back to project page SquareJam.

License

The source code is released under:

Copyright ? 2012 Stephen Molyneaux <@SHMolyneaux> unless otherwise noted This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License...

If you think the Android project SquareJam listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/* Copyright ? 2012 Stephen Molyneaux <@SHMolyneaux>
 * /*from  w  w  w .  ja v a 2 s  .  c om*/
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */

package com.example.squarejam;

import aurelienribon.tweenengine.BaseTween;
import aurelienribon.tweenengine.TweenCallback;

public class SquareColorChangeCallback implements TweenCallback {
  private Square block;
  private MyGdxGame game;
  
  private int color = -1;
  
  public SquareColorChangeCallback (Square block, MyGdxGame game) {
    this.block = block;
    this.game = game;
  }
  
  public SquareColorChangeCallback (Square block, MyGdxGame game, int c) {
    this.block = block;
    this.game = game;
    this.color = c;
  }
  
  @Override
  public void onEvent(int type, BaseTween<?> source) {
    if (color != -1) {
      game.changeColor(block, color);
    }
    
    else {
      game.changeColor(block);
    }
  }
}




Java Source Code List

com.example.squarejam.ApparitionCallback.java
com.example.squarejam.GameSequencer.java
com.example.squarejam.HelpAnimation.java
com.example.squarejam.Main.java
com.example.squarejam.MyGdxGame.java
com.example.squarejam.ReplaceGridCallback.java
com.example.squarejam.ScoreScreenCallback.java
com.example.squarejam.SpriteAccessor.java
com.example.squarejam.SquareColorChangeCallback.java
com.example.squarejam.SquareTouchCallback.java
com.example.squarejam.Square.java
com.example.squarejam.TouchProcessor.java
com.example.squarejam.client.GwtLauncher.java
com.shmolyneaux.squarejam.MainActivity.java