Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411468 Posts in 69368 Topics- by 58422 Members - Latest Member: daffodil_dev

April 22, 2024, 11:20:10 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperPlaytestingNine Levels
Pages: [1]
Print
Author Topic: Nine Levels  (Read 847 times)
bornander
Level 1
*



View Profile WWW
« on: February 08, 2018, 08:40:18 AM »

Hi,

I've been tinkering with a simple 2D platformer lately and I would appreciate any comments you guys might have on it.
The game is free, has no ads and it also does not have any in-app purchases.

The objective of the game is to collect all coins in a level as quickly as possible and since the game feature only nine levels I was hoping there would be some replay value gained from the use of Google Play leaderboards so that players can compare their times with other players'.

Google Play store link



Trailer




Thanks
Logged

Current devlog; Grapple
Try Hovercraft for Android, voted "a game" by players.Hovercraft on Google play
ROSSCOGames
Level 0
***


CEO of ROSSCO Games


View Profile WWW
« Reply #1 on: February 11, 2018, 10:32:15 AM »

Looks good! Love the pixel art!  Durr...?
Logged

Check out the games on my website!

bornander
Level 1
*



View Profile WWW
« Reply #2 on: February 17, 2018, 06:30:44 AM »

Looks good! Love the pixel art!  Durr...?

Thank you!
I wish I could take credit for the graphics but it's not mine, it's by GrafxKid.
Logged

Current devlog; Grapple
Try Hovercraft for Android, voted "a game" by players.Hovercraft on Google play
AlexGK
Level 0
**



View Profile WWW
« Reply #3 on: February 22, 2018, 06:03:51 PM »

Hey there.

The jump could use some work. It's supposed to send the character flying really fast at the beginning, and then gravity should start slowing it down. Right now, the jump starts slow, and it speeds up, and then it slows down.

After reaching the apex, gravity should pull the character down even harder until it lands (there must be a terminal velocity though).

Blocks should react immediately upon contact. I was able to jump like 8 times, but the block would only give me 4 coins.
Logged
quantumpotato
Quantum Potato
Level 10
*****



View Profile WWW
« Reply #4 on: February 22, 2018, 09:14:23 PM »

Can you share what you used for leaderboards?
I spent an hour reading through documentation that was all "this module is now deprecated and now split into 2 modules" and "this is the sample code -- does not compile"
Logged

bornander
Level 1
*



View Profile WWW
« Reply #5 on: February 25, 2018, 04:30:16 AM »

Can you share what you used for leaderboards?
I spent an hour reading through documentation that was all "this module is now deprecated and now split into 2 modules" and "this is the sample code -- does not compile"

I didn't use any libGDX code to integrate with the Google Play Leaderboards as I only support that on Android and therefore don't need cross-platform Leaderboards.

So instead I just looked at the Google API documentation for leaderboards and achievements and implemented that in a class in my android project, slapped an interface on that which then allows me to use it from the core project. For the desktop project I used a dummy implementation of the interface that does nothing.

Basically this is what I followed https://developers.google.com/games/services/android/leaderboards

The obvious downside to this approach is the lack of support on desktop, but if that is not a concern then adding leaderboard support "directly" by implementing the Google API in the Activity (or in a class used by the Activity) is simple.

In the gradle build file I added google() to the repositories for allProjects, then for the android project I added
Code:
        compile 'com.google.android.gms:play-services-auth:11.8.0'
        compile 'com.google.android.gms:play-services-games:11.8.0'
to the dependencies.


In my core project I added an interface that looks sort of like this:

Code:
package com.bornander.platformer;

public interface OnlineConnectivity {

void setCallback(OnlineConnectivityCallback callback);
boolean isOnlineCapable();
boolean isSignedIn();
void signIn();
void signInSilently();
void signOut();
void requestTopScores();
        void requestAchievements();
void submitScore(int scoreIndex, long score);
void unlockAchievement(int achievementIndex);
void viewLeaderBoards();
void viewAchievements();
}

That interface is then implemented by a class in the android project (or you can let your Activity implement it) so that it provides the actual implementation, for example:

Code:
    private GoogleSignInClient signInClient;
    private GoogleSignInAccount currentAccount = null;
    private LeaderboardsClient leaderboardsClient = null;
    private AchievementsClient achievementsClient = null;


    @Override // Override onCreate from Activity
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ...

        GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN).build();
        signInClient = GoogleSignIn.getClient(this, signInOptions);
    }



    @Override // Override signInSilently from my OnlineConnectivity interface
    public void signInSilently() {
        Log.info("signInSilently()");

        signInClient.silentSignIn().addOnCompleteListener(this,
                new OnCompleteListener<GoogleSignInAccount>() {
                    @Override
                    public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
                        if (task.isSuccessful()) {
                            try {
                                Log.info("signInSilently(): success");
                                currentAccount = task.getResult(ApiException.class);
                                Log.info("account" + currentAccount);
                                leaderboardsClient = Games.getLeaderboardsClient(AndroidLauncher.this, currentAccount);
                                achievementsClient = Games.getAchievementsClient(AndroidLauncher.this, currentAccount);

                                currentCallback.onlineSignIn();
                            }
                            catch(ApiException e) {
                                Log.info("signInSilently; failed " + e.getMessage());
                            }
                        } else {
                            Log.info("signInSilently(): failure", task.getException());
                        }
                    }
                });
    }

« Last Edit: February 25, 2018, 08:46:56 AM by bornander » Logged

Current devlog; Grapple
Try Hovercraft for Android, voted "a game" by players.Hovercraft on Google play
bornander
Level 1
*



View Profile WWW
« Reply #6 on: February 25, 2018, 08:54:31 AM »

Hey there.

The jump could use some work. It's supposed to send the character flying really fast at the beginning, and then gravity should start slowing it down. Right now, the jump starts slow, and it speeds up, and then it slows down.

After reaching the apex, gravity should pull the character down even harder until it lands (there must be a terminal velocity though).

I get what you're looking for, something closer to NES SMB jump physics.
Right now the jump is implemented by adding an impulse while the jump-key is pressed (for a limited time, of course), and that is what gives it the weird behaviour you mention; it accelerates during the beginning of the jump.
I guess I could do it the other way around and instead of applying a push up while the key is down, start applying a force down as soon as the key is released. I'll look into this.

Hey there.


Blocks should react immediately upon contact. I was able to jump like 8 times, but the block would only give me 4 coins.

The blocks contain only four coins. That is why you only got four but I can see what happened, the coins wait for the bump-animation to complete before spawning another coin but since the bump is visual only and the actual physical block is always in the same place you can hit it faster than the bump sometimes.
I can't really fix that without breaking some other part of the jump mechanic I am afraid.

Thanks for taking the time to comment and provide feedback, I really appreciate it.
Logged

Current devlog; Grapple
Try Hovercraft for Android, voted "a game" by players.Hovercraft on Google play
quantumpotato
Quantum Potato
Level 10
*****



View Profile WWW
« Reply #7 on: February 25, 2018, 06:49:25 PM »

Hey thanks so much, saved!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic