8-Bit Warrior Games + Design + Tutorials + Random

31Mar/130

[PersistGMS v0.1.7] – Custom Room Persistence for GameMaker: Studio

THIS IS AN EARLY EXPERIMENTAL VERSION AND LIKELY CONTAINS BUGS. USE AT YOUR OWN DISCRETION.
Currently, it should only be used for smaller projects.
Documentation can be found in the 'Create Event' of obj_PersistentManager.

-------------------------
HTML5 DEMO
...
.gmz Example Project DOWNLOAD ** Open using GameMaker's 'Import' menu.
...
obj_PersistentManager.object.gmx DOWNLOAD ** Right-Click -> Save Link As **
-------------------------

PersistGMS provides a foundation for custom room persistence in GameMaker. It is designed to be easy to use. Simply add the objects you want to remain persistent for each room to a list contained in obj_PersistentManager. For now, only the x/y values of persistent objects are recorded, but this can easily be extended to suit specific needs.

Feel free to check out the example project, or download and directly import obj_PersistentManager.object.gmx into your own project. There is no need to download additional scripts or .dll files.

Designed to work across all target platforms (Windows, Mac, Linux, iOS, Android, HTML5).
Feel free to report any bugs or design issues you face.

 

Persistent Action!

Persistent Action!

 

Tagged as: , , , No Comments
25Nov/123

TweenGMS v0.87b – Tweening Engine for GameMaker:Studio

Ease_Screenshot

EASE!!!

 

Download: TweenGMS v0.87b

You can see some quick examples of TweenGMS in action with the
HTML5 Example Demo or check out TweenGMS used in my games Battle Blocks, Sync Labs and Candy Crash.

TweenGMS is a framework which makes tweening a simple task in GameMaker. It can be used for such things as character/camera movement, fades, rotations, animations, awesome boomerangs, and much more!

There is not yet any documentation, as it will be supplied when TweenGMS becomes a bit more refined. However, there is a demo project supplied to help you get started.

This system is still relatively new and might have some bugs. Feel free to report any issues you have with TweenGMS or to give input on how it could be made better!

[Features]
-Easy setup and management of many tweens at once
-Persistent tweens for persistent objects
-Efficient code supplying fast performance
-Ability to assign tweens to designated groups for increased control
-Works across all target modules (Windows, Mac, iOS, Android, HTML5, Linux)

Example Code:

// ** Create Event **

// Create tween references
tween_x = TweenCreate(id);
tween_y = TweenCreate(id);

// Ease instance's x/y position from (0, 0) to (640, 480) over 60 steps
TweenPlayOnce(tween_x, x__, 0, 640, 60, EASE_IN_OUT_QUAD);
TweenPlayOnce(tween_y, y__, 0, 480, 60, EASE_IN_OUT_QUAD);

[Updates]

(v0.87b)
- Added delayed tweening functions. e.g. TweenPlayOnceDelay();
- Changed TweenSystemIsPaused() boolean to TweenSystemIsActive()
- Bug Fixes
- Optimizations

(v0.87a) - Warning! Not compatible with previous versions of TweenGMS.
- Removed need to call TweenDestroy(index) as tween clean up is now handled automatically.
- Updated TweenCreate(var_setter) to TweenCreate(instance_id);
* Argument determines which instance will be affected by tween
- Updated TweenPlayOnce(tween_index, var_setter, start, dest, dur, ease)
- Bug fixes

(v0.87)
- Converted tween scripts to GEX extension
- Added ability to assign delegates to tweens
- Simplified process to play different tween types
* TweenPlayOnce(), TweenPlayLoop(), TweenPlayRepeat(), TweenPlayBounce(), TweenPlayPatrol()

22Oct/120

Candy Crash – A Halloween Game


I recently had a sudden urge to make a Halloween game. As a result, I quickly whipped something together in about three days. Enjoy all its super amazingness+1!

Description:
It is Halloween night!
Well past your bedtime, you have landed the biggest score of candy ever. However, on your way back home, you have tripped and spilled your candy all over. Already high on too much sugar, your imagination goes wild as you find yourself caught in a monster mash.

You must recover as much candy as you can before you are overcome by your wild fears of ghosts, ghouls, vampire bats and spooky graveyards.

Features:
Local Scoreboard
Solid Touch Controls
Fun Challenging Atmosphere
A Kid in a Ninja Costume!
Pumpkins and Jack-o'-lanterns!

HTML5 Version
Play Now

Available for Android devices via
Google Play
Amazon.com
Direct APK download

Available for iOS devices via
iTunes

Available for Windows via
Direct Download

Available for Mac via
Direct Download

15Feb/121

[Game Maker] Grid Movement -PART 2- Collision Detection

Accompanying video tutorial. Suggested to watch in fullscreen at quality of 480p or higher:

NOTES
***
If you have not already done so, I highly suggest going through Part 1 of this tutorial series as what follows will be based upon its existing code. Links to other lessons can be found here:
Part 1: The Basics
Part 3: Character Animation

An editable gmk for this lesson can be downloaded here: Part 2 Download
***

1) Create a new object, naming it obj_grid

2) Create a new object, naming it obj_block

3) Assign obj_block a 32x32 sprite

Our obj_grid instance is going to manage our grid's collision information. It will initialize and hold a 2-dimensional array for storing locational information in our rooms. We will use the number 0 to represent an empty location, and the number 1 to represent a wall

4) Inside obj_grid, Add Event -> Create create, then add a piece of code code containing:

var i, j; // Not required but helps speed up 'for loop'

// Use the room's height and width divided by grid size (32) to
// initialize grid with 0
for (i = 0; i <= (room_width div 32); i += 1)
{
   for (j = 0; j <= (room_height div 32); j += 1)
   {
      cells[i,j] = 0;
   }
}

// This 'with()' statement will cycle through all obj_block instances
// within our rooms and use their relative x/y properties
with(obj_block)
{
   // Use block's x/y divided by grid size to set relative location
   // in cells[x,y] array to 1
   other.cells[x div 32, y div 32] = 1; // 'other' refers to obj_grid

   // For performance, we can remove the instance
   instance_destroy();
}

Now we are going to add some conditionals to our keyboard_check() blocks from part 1 to see if the corresponding direction next to our player is free. The code to be added will be marked by the comments '// <- ADD'

5) Inside obj_player -> Step step -> piece of code code, modify to match:


if (isMoving == false)
{
    if (keyboard_check(vk_right))
    {
        if (obj_grid.cells[(x div 32) + 1, y div 32] == 0) // <- ADD
        {
            isMoving = true;
            moveTimer = gridSize;
            speedX = moveSpeed;
            speedY = 0;
        }
    }

    if (keyboard_check(vk_up))
    {
        if (obj_grid.cells[x div 32, (y div 32) - 1] == 0) // <- ADD
        {
            isMoving = true;
            moveTimer = gridSize;
            speedX = 0;
            speedY = -moveSpeed;
        }
    }

    if (keyboard_check(vk_left))
    {
        if (obj_grid.cells[(x div 32) - 1, y div 32] == 0) // <- ADD
        {
            isMoving = true;
            moveTimer = gridSize;
            speedX = -moveSpeed;
            speedY = 0;
        }
    }

    if (keyboard_check(vk_down))
    {
        if (obj_grid.cells[x div 32, (y div 32) + 1] == 0) // <- ADD
        {
            isMoving = true;
            moveTimer = gridSize;
            speedX = 0;
            speedY = moveSpeed;
        }
    }
} 

 

With this work done, we can now set up our room with walls to run into. Before doing so, make sure you have a 32x32 background tile to represent as a wall.

6) Go ahead and add the wall tiles to our test room, anywhere you like, making sure to use a 32x32 grid size in the room editor's settings.

7) Place obj_block instances on top of the tiles you just placed

8) After selecting the room's 'Settings' tab near the top, find and click the button titled 'Creation code'. Once doing so, add this code:

instance_create(0,0,obj_grid);

There! Making sure you have obj_player in the room, go ahead and run your level. Your player should now properly detect the walls you have set out. Notice that the actual wall instances are removed, and only the more efficient background tiles remain.

Again, feel free to contact me with any comments or questions.
Happy coding!

31Jan/121

Global Game Jam Vancouver 2012

Vancouver Global Game Jam 2012 Poster

This past weekend I had the opportunity to attend the Global Game Jam in Vancouver. If you are into game development, I highly recommend joining such an event when the chance arises.

I have attended a 48 hour game jam before but this was the first jam in which I worked with a team of people. I had decided that this time, I would focus on assisting rather than leading.
I ended up working with five other awesome people, using C# with XNA Game Studio. This was really outside of my knowledge base as I mainly know C# through however it relates to C++ and I have never touched XNA.

But being slightly uncomfortable with what your are doing is what makes this experience great. Learning new things in such a short and exciting time is so rewarding. At the same time, you get to meet so many people in the same situation as you, struggling to the last minute to complete something, fueled by limited sleep and caffeine injections.
Under this pressure, you get to meet people in such a different way. Certain formalities may be lost at 4am of the second night.

Something I enjoyed most of all was walking around to different groups and seeing if I could assist them debug any problems they were having, especially with groups using Game Maker. The excitement from other groups also made me excited to see their successes, especially when they had never made a game before!

My group and I struggled to get our game finished on time, getting about half of what we wanted done. But despite that, it was great fun. After programming alone for so long, it was a fantastic experience to work with others. Having now returned home, I am left slightly depressed to be once more alone with my code. Maybe I should get out more!

I don't have a playable link to the game I worked on, so instead, here's a link to a small game I made in 20 minutes while at the jam! I call it Fail Fall
Please, hold the applause :P

Also, I'd like to highlight one game I especially loved that came from the jam: Pyramid Defense
Be sure to check it out!