playMaker

Author Topic: Donkey Kong with playmaker wip  (Read 1503 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Donkey Kong with playmaker wip
« on: October 14, 2022, 03:53:57 PM »
In an effort to improve my abilities as a game developer I decided to try and recreate the classic "Donkey Kong" in 2D using sprites and playmaker.

Barrels and fire sprite
Game Play
To be honest I do not clearly understand how to use the sprite editor when using a sprite sheet; so I choose to use playmaker to control the sequence of sprites to play when walking, jumping and climbing.

I had difficulty when using a sprite character wielding the hammer, its position was different to the main walking. So I used a separate game object as a child and switched between them for hammer time, but detecting only the hammer head for trigger events proved difficult so, in the end, I added the hammer with an animation that matches the sprite to the main character its sprite renderer is disabled.

Mario is the parent, hammer pickup in use is the hammer with the animation and Mario hammer is the sprite who walks with the hammer.

Rolling Barrels: use a random float "timer" min 4, Max 8 with float compare action equal or greater than roll a barrel.

Ascending fire sprite: uses four separate game objects in order to achieve the onscreen movement.

1. direction node tells the fire sprite to move in a given direction "send event by name to the current fire sprite"

2. A trigger allows the fire sprite to climb it activates a fireball ladder with its own trigger checked and waits for 1.2sec to finish and deactivate the fireball ladder.

3. the fire sprite "ladders FSM" listens for this event and allows the sprite to climb the ladder on exit reset the ignore collisions and reactivate the normal movement.

There must be a better way to do this, can you help me out?

 

blackant

  • Hero Member
  • *****
  • Posts: 525
  • http://blackantmaster.com
    • blackantmaster.com
Re: Donkey Kong with playmaker wip
« Reply #1 on: October 14, 2022, 04:41:03 PM »
To be honest I do not clearly understand how to use the sprite editor when using a sprite sheet; so I choose to use playmaker to control the sequence of sprites to play when walking, jumping and climbing.

To animate a Sprite you must create an animation and drag and drop a different sprite on each new created frame. Then you call the animation when needed.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Re: Donkey Kong with playmaker wip
« Reply #2 on: October 15, 2022, 11:07:32 AM »
My issue is the sprites are of different sizes running 16 x 16 climbing 13 x 16 and using a hammer is 30 x 26.

The using hammer is the biggest sprite that is used for the character, in order to tile correctly all of my sprites should be this size I think?

link to sprites: https://mario.fandom.com/wiki/Donkey_Kong_(video_game)/Gallery

As you can see most of these sprites are cropped, could you advise on the best approach to have each sprite the correct size?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Donkey Kong with playmaker wip
« Reply #3 on: October 15, 2022, 11:40:24 AM »
on sprite editor you can set the pivot point to bottom center, that might help :)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Re: Donkey Kong with playmaker wip
« Reply #4 on: October 15, 2022, 01:27:37 PM »
I think ill just use single sprites and not use the sprite sheet option at all.

I can use the hammer is 30 x 26 as a reference and import the walking on a different layer and save, but hide the hammer sprite.

Do the same for the other character sprites and keep the pivot point to the centre for them all.

It's less efficient but easier for me to work with, also I am not using an animation controller.




colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Re: Donkey Kong with playmaker wip
« Reply #5 on: October 17, 2022, 08:27:38 AM »
In relation to my Ascending fire sprite: uses four separate game objects in order to achieve the onscreen movement.

I am now using a single trigger it listens for the fire sprite with a transition to a random event to either climb or not.

To climb I disable the movement fsm with a reset on exit set the gravity scale to zero and translate 2D in the y direction by 1 per sec for every frame ignoring the collisions of the platform I wish to pass through and then wait; these times are different depending on the height I wish to finish at.

But when finished I tell the specific fire sprite to move either left or right reset the gravity scale and no longer ignore the platform.

This method seems a much better way as I am only using one trigger, But I am unsure if this way may have issues, can you advise, Please?