How to series - 'In Game Shop'

UpvoteUpvote 5 DownvoteDownvote

Index

Features on these Courses

Stats

13,271 visits, 33,111 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 12 Jan, 2012. Last updated 19 Feb, 2019

Now we'll play with the game layout, and event sheet

On the game layout add a sprite for the player, some ground and a level complete sprite. I'm simply using colored boxes.

- Give the player the platform behavior.

- Give the ground a solid behavior.

- Feel free to add anything you want to the game.

- you can add a scroll to behavior to the player if you want to, but im going to show you how to do this through the event sheet.

This is how mine looks:

Lets add some code :D

- Im going to quickly show you how to scroll to the player without using the scroll to behavior. This can be usefull if you need to show a little bit ahead of the players position ect.

So open your game layout and event sheet, and drop this code in:

     System.EveryTick
        -> System.scrollToPosition(Player.X, Player.Y)

simples right? :D

Should look a little like this:

Lets Save those variables

- sorry i forgot to show you how to save those variables before we give them to the player.

Go back to the shop layout and add another button, name it 'GoToGame' or something appropriate.

Now add this event:

     GoToGame.OnClick
          -> Webstorage.setLocalKey("SavedMoney" to Money) // Here were naming a local key 'SavedMoney' <- this can be what ever you want, and were giving the local key a value of Money, The variable we have 
          -> Webstorage.setLocalKey("SavedSpeed" to PlayerSpeed) // saving speed
          -> Webstorage.setLocalKey("SavedArmor" to PlayerArmor) // saving armor
          -> Webstorage.setLocalKey("SavedJumo" to MaxJump) // saving max jump
 

This is how it should look:

Now we can apply these saved values to the player :D

So we need a system on start of layout event.

Thats it for the tutorial my PC keeps crashing on me, So please just take a look at the capx and PM me or comment if you need any help :) Thanks.

  • 5 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Figuring out how to make your shop actually work—not just exist—is a whole journey. For me, the turning point was realizing how much smoother things run when all systems talk to each other properly. I was struggling with keeping inventory, orders, and customer data synced until I came across a team that helped me integrate everything through Magento. It seriously made a difference. I used perspectiveteam.com/services/magento-integration for the integration part, and the whole setup just clicked after that. If anyone’s stuck juggling disconnected tools, getting solid integration help is a game changer.

  • Can i get the capx? This capx is not active. Pls help me!

  • Thank you! You help me so much! :D

  • Same here. I t will be nice to have this tutorial again. Very useful!

    Thank you

  • Hi. The capx address is not valid anymore. Is there a way to get it again?

    Thanks