Hello Guest

Author Topic: Adventure Game Tutorial Series  (Read 227584 times)

0 Members and 1 Guest are viewing this topic.

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #15 on: February 20, 2014, 07:50:42 PM »
This turned out really great! Thanks for putting in so much effort to get a nice tutorial series out there ;D

No problem! Thanks for making Otter :D

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #16 on: February 22, 2014, 10:42:47 AM »
The final post is finally up! I hope a few of you found the entire series useful. If anyone has any questions, or finds any bugs, typos or whatever, feel free to contact me on Twitter. I'm more than happy to help!

Per request, I should have an Ogmo tutorial up at some time in the near future. It won't be related to the series, but should be in a similar format, but just one post long.

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #17 on: May 07, 2014, 05:56:08 PM »
A TIGSource member found a few bugs in various tutorial entries due to a few changes that have been made to Otter over time. I'll have fixes up by the end of the weekend!

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #18 on: May 11, 2014, 10:58:13 PM »
Cool.  Actually, some more changes are probably on the way for the graphics stuff.  Probably nothing too major, but a lot of clean up (I hope) of how graphics are created and used.

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #19 on: September 29, 2014, 09:13:53 PM »
It has been awhile, but I went and updated parts 1 through 7 for my tutorial series for Otter v0.9.6. I received a few emails requesting that I do so. :)

I'll get to parts 8, 9 and 10 tomorrow.

Thanks to everyone who provided feedback!

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #20 on: September 30, 2014, 12:07:58 PM »
Cool!  That reminds me I should be pushing a big update soon with all of the dev branch changes. ;D

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #21 on: September 30, 2014, 07:33:42 PM »
Ha, I just saw the changes. I updated parts 8, 9 and 10 and also noted in my posts that the Glide API was updated., The calls to Glide were the only affected API calls in my code. Thanks for the heads up!

gotnull

  • Member
  • Posts: 1
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #22 on: October 02, 2014, 09:28:27 PM »
Any chance of someone doing an OgmoProject tutorial? I'm looking to make a 2D platformer (Cave Story, Metroid, etc) and was hoping to use either Tiled or OgmoEditor for the tiles and collisions.
« Last Edit: October 02, 2014, 09:34:23 PM by gotnull »

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #23 on: October 03, 2014, 12:06:29 AM »
Sure, Otter has an OgmoProject.cs file that will help with loading levels quickly, but I can also whip up a guide on how to use it as well.

floatvoid

  • Member
  • Posts: 11
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #24 on: October 03, 2014, 11:43:34 AM »
This thread here has everything you need to get started with an Ogmo project

http://otter2d.com/forum/index.php/topic,13.0.html

@floatvoid on twitter

jasin

  • Member
  • Posts: 8
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #25 on: October 21, 2014, 10:53:13 PM »
Eric - Thanks for putting this together. I'm starting to go through this.

I was getting path not found on the image. First - it wasn't set to copy on build. So I had to set all assets to copy if newer.

Also I had a question - why are you going down 2 directories? Since the Assets folder is in the same folder as the program. I was still getting path not found.

Changing
    public const string TITLE_IMG = "../../Assets/Graphics/otter.jpg";
to
    public const string TITLE_IMG = "Assets/Graphics/otter.jpg";
« Last Edit: October 21, 2014, 10:54:45 PM by jasin »

ericmbernier

  • Member
  • Posts: 35
  • Sometimes I make games.
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #26 on: October 22, 2014, 09:47:49 AM »
Hey Jasin,

Some of the stuff might be a bit off from when I first wrote it. I provide the latest source code so you can poke through it, which I've run and tested myself. Feel free to do so if something seems wrong in the blog posts.

Which image was causing the error?

Also, did changing ../../ to just Assets fix your issues?

jasin

  • Member
  • Posts: 8
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #27 on: October 22, 2014, 10:38:51 AM »
Hey Eric,

I was just following it from scratch and pointing our my issues.

1 - I had to set each asset to copy always or copy if newer.

2 - I had to remove ../../ from every Asset since they we not in a below folder. Assets folder is in the same dir as the exe.

Unless you were making it an embedded resource?

Edit - I think I see. You have it as it is accessing the Assets folder in the resources directory below the bin. I set mine to output the Assets folder on build. This way if you copy all files in the debug/release folder its the whole package. Which prob isn't needed as you could have a script copy the assets to the published directory.

However having the ../../ might confuse people trying to copy their program somewhere else because now the assets need to be 2 directories lower than the executable.
« Last Edit: October 22, 2014, 10:47:26 AM by jasin »

Ceric

  • Member
  • Posts: 3
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #28 on: November 30, 2014, 10:34:38 PM »
Hi Eric,

Great tutorial so far.

I ran into an issue in part 8. I'm using the latest version of Otter (0.97) and for some reason the tweening function isn't working properly. When the player gets to the edge of the screen, it appears to attempt to tween repeatedly. FYI the only difference between the code I'm using and the code in your project file is the use of Glide.GlideManagerImpl. in front of Tweener.Tween, etc. At first I thought it was a typo on my part, but I copied your code from the Git repository and just took out Glide.GlideManagerImpl as you suggested, and scrolling is still not working.

Have there been any changes to how tweening works that would cause the game to attempt to tween repeatedly rather than actually tween once? I did check the source for Otter itself, comparing the version in your project vs. the one in mine, and in the one I'm using under Scene it has Tweener : Tweener rather than Tweener : GlideManager, so that appears to be where things have changed.

Any advice for making this work with 0.97 would be helpful.

Everything else in your tutorial has been perfect up to this point. The map loads, collisions are fine, everything else is working, etc.

For what it's worth, here's the code I have for the Scroll() and ScrollDone() functions. This is what I copied and edited by removing Glide.GlideManagerImpl.

Thanks for any help you can provide. Also, thanks for making this tutorial in the first place!

Code: [Select]
public void Scroll(int dx, int dy)
        {
            // Pause the game when we start scrolling
            Global.paused = true;
            // Set the nextScene and call UpdateLists to
            // ensure all Entities are cleaned up properly
            nextScene = new GameScene(screenJ, screenI, Global.player);
            nextScene.UpdateLists();
            // Push the player over with the screen via a Tween
            float pushPlayerX = dx * 30;
            float pushPlayerY = dy * 30;
           
            Tweener.Tween(Global.player, new
            {
                X = Global.player.X + pushPlayerX,
                Y = Global.player.Y + pushPlayerY
            }, 30f, 0);

            // Finally, push the Camera over by a multiple of the
            // Game's width and height, and set the call back method
            // to our new ScrollDone method
           
            Tweener.Tween(this, new
            {
                CameraX = CameraX + Global.GAME_WIDTH * dx,
                CameraY = CameraY + Global.GAME_HEIGHT * dy
            }, 30f, 0).OnComplete(ScrollDone);
        }
        // Method called once the screen scrolling is all done

        public void ScrollDone()
        {
            // Once the scroll is done remove all added graphics
            // and call UpdateLists to clean everything up and
            // then switch to the nextScene
            RemoveAll();
            UpdateLists();
            // Set the nextScene's Camera values to the current Scene's
            // freshly tweened camera values, otherwise we snap back to screen 0,0
            nextScene.CameraX = CameraX;
            nextScene.CameraY = CameraY;
            Global.TUTORIAL.SwitchScene(nextScene);
        }
    }

Fruckert

  • Member
  • Posts: 60
  • Total Square
    • View Profile
Re: Adventure Game Tutorial Series
« Reply #29 on: December 01, 2014, 01:11:55 AM »
A tween in my game broke, too.
The tutorial's a biiit out of date by now. Lots of changes since it was written.
« Last Edit: December 01, 2014, 01:13:26 AM by Fruckert »