Skip to content

:octocat: Mobile game development library for android. Android Studio lib

License

Notifications You must be signed in to change notification settings

Hutsalod/HutMovie

Repository files navigation

⠀ ⠀⠀ ⠀

⠀ ⠀

HUTMOVIE ✌️🚀

Mobile games development library for android. Android Studio

GitHub release (latest by date) GitHub Buy Me A Coffee donate button

🛠 CONNECTION

Project:app

	
	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  

Module:app

	
	dependencies {
          implementation 'com.github.Hutsalod:HutMovie:1.3.1'
  	}
  	

📃 DESCRIPTION OF LIBRARY FUNCTIONS

Methods Description
show(); Animation of appearance
hide(); The attenuation animation
Methods Description
left(); Move the object to the left
right(); Move the object to the right
up(); Move the object to the up
dowm(); Move the object to the down
move(); Move edges by X and Y
position(); Move the object to the X and Y
rotation(); objecct rotation
collision(); Collision of an object with an object
jump(); High jump
follow(); Movement to the object
Methods Description
isRoom(); The object is not in the room
repeat(); Repeat the animation

🎲 EXAMPLE CODE

activity_main.xml 🎨

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/grass">
  
  <ImageView android:id="@+id/Person1"
      android:layout_width="50dp"
      android:layout_height="50dp"
      app:srcCompat="@drawable/sprite" />
  
  <ImageView android:id="@+id/Person2"
      android:layout_width="50dp"
      android:layout_height="50dp"
      app:srcCompat="@drawable/sprite2" />
  
</FrameLayout>

MainActivity.java 🛠

public class MainActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main); 
  
      HutMovie person1 = new HutMovie(findViewById(R.id.Person1));
      HutMovie person2 = new HutMovie(findViewById(R.id.Person2));

      person1.right(200)
             .down(200)
             .repeat(true)
             .onRun();

      person2.move(200,300)
             .repeat(true)
             .onRun();
  	
  }
  
}

Running app 📲

🎲 EXAMPLE CODE II COLLISION

activity_main.xml 🎨

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/grass">
  
  <ImageView android:id="@+id/Person1"
      android:layout_width="50dp"
      android:layout_height="50dp"
      app:srcCompat="@drawable/sprite" />
  
  <ImageView android:id="@+id/Person2"
      android:layout_width="50dp"
      android:layout_height="50dp"
      android:layout_gravity="right"
      app:srcCompat="@drawable/sprite2" />
  
</FrameLayout>

MainActivity.java 🛠

public class MainActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main); 
  
      HutMovie person1 = new HutMovie(findViewById(R.id.Person1));
      HutMovie person2 = new HutMovie(findViewById(R.id.Person2));

      person1.move(400,400).onRun();

      person2.move(-400,400).collision(person1).onRun();
  	
      person2.setAction(new HutMovie.Collision() {
             @Override
             public void onActionCollision() {
             Toast.makeText(getApplicationContext(), "WORKING!",Toast.LENGTH_LONG).show();}
      })
  
  }
  
}

Running app 📲

👏 EXAMPLE GAME

✍️ How to build

Retrolambda needs java8 to be installed on your system

export ANDROID_HOME=/path/to/android/sdk

git clone https://github.com/Hutsalod/HutMovie
cd HutMovie

echo "sdk.dir="$ANDROID_HOME > local.properties

./gradlew assembleDebug

📃 Bug report & Feature request

Please report via GitHub issue :)