Tom Atom

[Book & Game] Goblin Run - Procedural endless runner

Recommended Posts

Hi, I am proud to announce I finally finished my first Phaser book: Create procedural endless runner in Phaser with TypeScript. Book is one big tutorial on creating procedurally generated endless runner from setting up project to full game with various features like spikes, in-air bonus jumps, gold to gather.

Book.jpg

 Full game developed through the book can be played here: http://sbc.littlecolor.com/goblinrun

 GoblinRun02_small.png   GoblinRun04_small.png

 Currently, book is available at Gumroad. You can also read short blog post about it here: http://sbcgamesdev.blogspot.com/2016/09/phaser-book-on-making-procedural.html

 This book is not for absolute beginners, who are learning what is variable and how to make loop. It is for people who have some basic knowledge what is Phaser, how to make something simple with it and now want to make something “bigger”, what will be beyond simple how-to examples. All aspects of game are covered, including evergreen topic on scaling for various window sizes :):

Scale.png

 

Share this post


Link to post
Share on other sites

Just an FYI, but the link you included in the post has a typo. I was able to figure it out and give the game a play though.

Really polished looking game you have here! Definitely a good job done with the scaling too, which you mentioned. I know getting the scaling to work just the way I wanted it was a little tough the first time around, so I'm sure the book will be a valuable resource for those looking for help. I hope you have a lot of success with it!

Share this post


Link to post
Share on other sites
21 hours ago, lumoludo said:

Just an FYI, but the link you included in the post has a typo. I was able to figure it out and give the game a play though.

 Thanks a lot! Link is corrected.

21 hours ago, lumoludo said:

Really polished looking game you have here! Definitely ...

 Thanks again. In the beginning I was looking for universal scaling solution, but it is game what is in center. Game genre or gameplay determines what scaling strategy to use. And if you have clear picture how you want it work, then coding it is easy :)

 For book, my weakest point is marketing. Fortunately, it is listed at Phaser site shop page, which may bring some customers. So far, there is 15 sales, but I believe there will be more people interested in it ... especially now, when link is corrected and they can see what is result of coding in book :)

Share this post


Link to post
Share on other sites

@jamesgeorgedunn Hi, I think the best way would be to make score persistent across states changes. For it, add it into Preferences (Chapter 16, 17) and save it along with other settings. You can make more variables like last score, highest score,... You can then read it back anywhere in game.

 For displaying: if you want just to display number, then use Phaser.BitmapText. Or, if you also want gold icon like in game UI, you can reuse class ScoreUI. Just create instance of it and set its score property to desired value:

let scoreUI = new ScoreUI(this.game, this.world);
scoreUI.score = Preferences.instance.hiScore; // or last score ... whatever you want and added into prefs

 

 Another way would be to question Play state for score. You can add getter to get value of private property _score into Play state:

public get score(): number {
    return this._score;
}

 Then you can question it from other states like this:

let score = (<Play>this.game.state.states["Play"]).score;

 Score will be kept there until next game is started.

 

Hope, it helps...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.