Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [ID] Topic: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)  (Read 217994 times)

0 Members and 1 Guest are viewing this topic.

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
0
I'll add a second conditional to the stage_init() to allow also building on one tile layer.

ANyway, back to spending my time with the girl for tonight.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Notice to Anyone Currently Using my Engine
« Reply #196 on: July 30, 2011, 07:11:41 PM »
0
In the next version, the block tile layer will be changed from 999998 to 999990 because of my insistence on using Tile Square Assemblies for my maps. To make vertical rooms easier for me to handle, I freed up layers 999991 thru 999999, which means you will need to go through each of your rooms if you have any already designed, click on the TILES tab, select layer 999998, then click CHANGE and type in 999990. It's simple and shouldn't cause any problems. Just wanted to give you all a heads up since many of you might overlook the change notes and wonder why stage_init() starts giving errors.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
0
Got it, I'll keep that in mind. I only have the two rooms done so it shouldn't be a big deal. I figured you might have to do something like this so I've been working on other stuff in the mean time.
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #198 on: August 23, 2011, 10:29:37 AM »
0
I will release an updated patch soon, don't worry. I'm working out a couple kinks in my code for vertical stages. No, it has nothing to do with my TSA rules; my code handles that without issue (quite nicely, too! no noticable lag or restructuring!). There's just an issue in my stage scrolling code that's causing some chop, but I'm certain I spotted the issue while looking through my code last night. I'm also cleaning up Belmont's code to make editing the step event a little easier by compiling similar codes into scripts.

Anyway, I just wanted to post here because I think I forgot to mention in my last progress report that in order to accomodate those who will not use TSAs, I scripted stage_init() to search the room on a tile-by-tile basis at layer 1000000 (the default tile layer) and check it against the tilesheet. So if you have a tilesheet with the "solid block" tile at tilesheet coordinates [0,0] (top-left corner), it will place the block object over that tile. With some simple editing, you can have multiple "solid block" tiles in a tilesheet and check against each of them. This method negates the need for layer 999990, which is necessary for TSAs (actually it's not, but my current method for dealing with TSAs is only slow when stage_init() runs but not afterward since stage_init() deletes tile layer 999990 when it's done compiling the stage). Keep in mind when using this method that you must place tiles one at a time. You cannot select 4 tiles in the tilesheet while holding shift to place a tile block, as GameMaker treats tile blocks as one tile; or at least I think that's the case seeing as how when I ran in debug mode it wouldn't display the info for each tile, only the tile blocks.

Also, arrange doors in your tile sheets as follows:


 ____  ____   ____  ____
|    ||    | |    ||    |
|____||____| |____||____|
    ||
    ||
    ||
    ||

They can go anywhere in the tile sheet, but make sure the "open" tiles are immediately to the left of each door combo. In TSA terms, these should be [1x2] in size, or [4x8] tiles. Yes, this is a bit wasteful and jacks up the file size a tad, but it was the easiest way for me to program doors for all tile sets.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #199 on: August 23, 2011, 06:14:49 PM »
0
Anyway, I just wanted to post here because I think I forgot to mention in my last progress report that in order to accomodate those who will not use TSAs, I scripted stage_init() to search the room on a tile-by-tile basis at layer 1000000 (the default tile layer) and check it against the tilesheet.

I'm curious how you did this 'cause I was gonna do it myself, but never got around to and have left it to the side for now.
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #200 on: August 24, 2011, 05:11:08 PM »
0
As I said before, I think in the Game Info if not here, tiles have their origins at (0,0) in the room. They also have their origins in the tile sheet. You can use tile_get_left() and tile_get_top() to check against the tile sheet. I will post the stage_init() script tonight.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #201 on: August 24, 2011, 05:49:13 PM »
0
Cool. I'll keep an eye out for it.
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #202 on: August 25, 2011, 01:16:31 PM »
0
Code: [Select]
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
        tile_id = tile_layer_find(1000000,xx*16,yy*16);
        if tile_id > -1 && !collision_line((xx)*16,yy*16,xx*16,yy*16,prt_ground,0,0)
        {
            if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                with(brick)
                {
                    tile_id=tile_layer_find(1000000,x+span*16,y);
                    while (tile_id>-1)
                    {
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        {
                            image_xscale=span+1;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x+span*16,y);
                        }
                        else tile_id=-1;
                    }
                    span=0;
                    tile_id=tile_layer_find(1000000,x,y+span*16);
                    while (tile_id>-1)
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        {
                            image_yscale=span+1;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x,y+span*16);
                        }
                        else tile_id=-1;
                    }
                }
            }
        }

This is the "non-engine" format I guess. >_> You can look through it and see how I did everything. In this case, no tiles are deleted. This also includes the more efficient version of the block placer whereby the block object gets stretched out. Test it, make sure it works right. If you have suggestions, let me know. The code isn't "perfect" because I think I gave vertical checks priority over horizontal checks, since you're more likely to find vertically long walls. This code has should have little effect on stairs, although it just occurred to me that the following would be less efficient than my old code:


A  ■■■■■■■■     B   ■■■
  ■■■■■■■■■■■      ■■■■■■
■■■■■■■■■■■■■      ■■■■■■■■


In A, it would create 7 blocks I think. In B, I think it would create 4 blocks. In both cases, the old code would have made 3 blocks. ... I think. I need to test that out. I could be wrong and it could work just fine as is, maybe. {EDIT: Actually, as the code is now, it works fine in both cases with no change in the number of block objects created, however the objects would overlap in the primary corner, which may just be wasteful or it may also create future bugs.} Also, in my code, it creates overlapping blocks. Also, in cases where you have niches in a wall on the right-hand side, this would make the niche solid too. So yes, there are still some glitches in my "efficient" version, although for the MOST part it is more efficient.
« Last Edit: August 25, 2011, 01:46:04 PM by TheouAegis »
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #203 on: August 25, 2011, 03:57:47 PM »
0
Yeah, I ran into similar problems when I was messing with the old code before. In particular it would either refuse to make the upper right block if I had an upside-down "L" pattern set up or fill it up as if it was box the size of the two arms of the upside-down "L".
I'll have a look at the new code and see what I can come up with. Thanks!   ;D
« Last Edit: August 25, 2011, 04:20:45 PM by Inccubus »
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #204 on: August 25, 2011, 07:35:56 PM »
0
I derped my code earlier. Here's a revised version (with the missing conditionals I forgot to include in my last post):

Code: [Select]
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
            tile_id = tile_layer_find(1000000,xx*16,yy*16);
            if tile_id && !collision_line(xx*16,yy*16,xx*16,yy*16+1,prt_ground,0,0)
            {
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
                if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                {
                    brick=instance_create(xx*16,yy*16,prt_ground);
                    span=0;
                    stretch=0;
                    with(brick)
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                    {
                        tile_id=tile_layer_find(1000000,x+span*16,y);
                        while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                        {
                            if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                            {
                                image_xscale=span+1;
                                stretch=span;
                                span+=1;
                                global.haha=span;
                                tile_id=tile_layer_find(1000000,x+span*16,y);
                            }
                            else tile_id=-1;
                        }
                        span=0;
                        tile_id=tile_layer_find(1000000,x,y+span*16);
                        tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                        while(tile_id && tile_id2)
                        {
                            if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                            {
                                if tile_get_left(tile_id2)=0 && tile_get_top(tile_id2)=0
                                {
                                    image_yscale=span+1;
                                    span+=1;
                                    global.hehe=span;
                                    tile_id=tile_layer_find(1000000,x,y+span*16);
                                    tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                                }
                                else tile_id2=-1;
                            }
                            else tile_id=-1;
                        }
                    }
                }
            }
        }
    }
}

I tested it a little more. There may still be some bugs, so let me know if you find any. Currently, there is one "bug" that I am not considering a bug per se because I coded it to allow said bug:

■■■■■
■□■■■
■□■■■
■■■■■

In this case, the empty squares would be rendered impassable. Unlike the previous code, however, the following would work correctly to my knowledge:

■■■■■
■■■■□
□■■■□
■■■■■

The above case should create 4 blocks with the empty spots left open. In other words, as long as the empty spots are on the far left or far right of a set of block tiles, they won't be covered with the block object.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #205 on: August 25, 2011, 09:30:47 PM »
0
OK. Yoinked the new version.
As for your "bug", yeah, I really wouldn't call it a bug. Makes sense not to bother leaving empty spaces if they're surrounded by solid blocks on all sides.

I'll test the new routine in the morning and report back when I finish.
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #206 on: August 25, 2011, 10:56:35 PM »
0
My breakable wall script will eventually render holes in the wall moot, as it will probably force a rewrite of the block objects. Haven't messed with it much yet, but i have my worries that it may cause some slight hiccups in gameplay. Either way, we'll know when the time comes. For now, I'm still working out all the kinks in vertical scrolling stages and stair transitions (they work going up, but i'm having issues going down). THAT'S WHAT HE SAID!

Also, delete global.haha and global.hehe from the script. For starters, it would tip me off that you used my code and if u didn't give credit by final release... tsk tsk. And anyway, it was just for debugging purposes. I forgot to take them out when I posted the code for you.
« Last Edit: August 25, 2011, 11:07:56 PM by TheouAegis »
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline Inccubus

  • Wannabe Great Old One
  • Master Hunter
  • *****
  • Posts: 3287
  • Gender: Male
  • Warrior
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. SuperOld Dungeonite: Members who have been around since the oldOLD days. Permanent Resident: Seems to always be around to post/reply.
    • Awards
  • Favorite Game: Vampire Killer (MSX)
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #207 on: August 26, 2011, 12:19:27 AM »
0
Got it.

About the breakable walls. Aren't those handled as separate objects in CV3? They are in CV1 as far as I can tell.
"Stuff and things."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
« Reply #208 on: August 26, 2011, 09:14:00 AM »
0
There may be an object associated with them, but they're still part of the actual background in CV3. Hitting a breakable wall forces a change in the name table. It's actually the same with CV1. So in other words, yes there is an object involved, but the object itself alters the game's background tile data.

While I could in theory program my engine to run off tile collision entirely, working with objects is much easier. So if it comes down to it, I may have to convert breakable walls to strictly object-oriented to simplify things. But for now I will relish the challenge of keeping it as I had started it.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1861
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
EUREKA! The ultimate tile solidification script!
« Reply #209 on: September 17, 2011, 09:02:54 AM »
0
I've done it! I think I've officially completed my tile solidification script that first debuted in its alpha form in the first release of my Dracula's Curse engine. The new script is vastly improved over the original in the following ways:

*Works with both TSAs and single-layer tile arrangements
*Large rectangular or square groups of tiles will be covered by one block
*Inaccessible holes deep inside walls will be treated as solid, which makes sense
*Gaps in ceilings will not be blocked off
*Complicated block or ceiling patterns are now economized/more efficient
*BLOCK COUNT REDUCED DRASTICALLY!

I am releasing this code outside of my engine because I'm sure it will be useful to a lot of people that use GameMaker. The TSA version is a bit of a misnomer, though. Really, it's just for any multilayered tiling. So the earliest releases of my Dracula's Curse engine used two layers (1000000 and 999998), so they would use the TSA version. Using the single-layer version requires a bit more work to use.

Here's a screencap of it in use. The blue represents covered areas. For those who are wondering, the blue shows up over the black areas too in the developmental stage.


TSA/Multi-layer Tile Version
Code: [Select]
//Shifts TSA tiles up every screen in vertical scrolling stages
//Use a new tile layer between 999981-999990 for every 256 pixels of height
if room_height>256
{               
    h=floor(room_height/256)-1;
    room_base-=16*h+27;
    with (all)
    {
        if y>256
        {
            y-=16*floor(y/256);
        }
    }
    repeat(h)
    {
        tile_layer_shift(1000000-h,0,-16*h);
        tile_layer_shift(999990-h,0,-16*h);
        h-=1;
    }
    for(i=1;i<10;i+=1)
    {
        tile_layer_depth(999990-i,999990);
        tile_layer_delete(999990-i);
    }
}

//Places prt_ground objects over each tile in layer 999990
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
        tile_id = tile_layer_find(999990,xx*16,yy*16);
        if tile_id
        {
            if!collision_line(xx*16,yy*16,xx*16+1,yy*16+1,prt_ground,0,0)
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                stretch=0;
                with(brick)
                {
                    tile_id=tile_layer_find(999990,x+span*16,y);
                    while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                    {
                        image_xscale=span+1;
                        stretch=span;
                        span+=1;
                        tile_id=tile_layer_find(999990,x+span*16,y);
                    }
                    span=0;
                    tile_id=tile_layer_find(999990,x,y+span*16);
                    tile_id2=tile_layer_find(999990,x+stretch*16,y+span*16);
                    while(tile_id && tile_id2)
                    {
                        image_yscale=span+1;
                        span+=1;
                        tile_id=tile_layer_find(999990,x,y+span*16);
                        tile_id2=tile_layer_find(999990,x+stretch*16,y+span*16);
                    }
//This section checks for gaps in ceilings with TSA tiling.
//Ideally, your stages should rarely need to actually use this script.

                    span-=1;
                    hole[0]=0;
                    for (i=1;i<stretch;i+=1)
                    {
                        hole[i]=0;
                        tile_id=tile_layer_find(999990,x+i*16,y+span*16);
                        if !tile_id
                        {
                            hole[i]=1;
                            hole[0]=1;
                        }
                    }
                    if hole[0]=1
                    {
                        while hole[0]=1
                        {
                            image_yscale-=1;
                            span-=1;
                            hole[999]=0;
                            for (i=1;i<stretch;i+=1)
                            {
                                tile_id=tile_layer_find(999990,x+i*16,y+span*16);
                                if !tile_id
                                {
                                    if hole[i]=1
                                        hole[999]=1;
                                }
                            }
                            if hole[999]=0
                                hole[0]=0;
                        }
                    }
                }
            }
        }
    }
}
tile_layer_delete(999990);

Single-Layer Tile Version
Code: [Select]
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
        tile_id = tile_layer_find(1000000,xx*16,yy*16);
        if tile_id && !collision_line(xx*16,yy*16,xx*16,yy*16+1,prt_ground,0,0)
        {
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
            if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
            //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                stretch=0;
                with(brick)
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                {
                    tile_id=tile_layer_find(1000000,x+span*16,y);
                    while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                        {
                            image_xscale=span+1;
                            stretch=span;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x+span*16,y);
                        }
                        else tile_id=-1;
                    }
                    span=0;
                    tile_id=tile_layer_find(1000000,x,y+span*16);
                    tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                    while(tile_id && tile_id2)
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                        {
                            if tile_get_left(tile_id2)=0 && tile_get_top(tile_id2)=0
                            //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                            {
                                image_yscale=span+1;
                                span+=1;
                                tile_id=tile_layer_find(1000000,x,y+span*16);
                                tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                            }
                            else tile_id2=-1;
                        }
                        else tile_id=-1;
                    }
//This script checks for gaps in ceilings with single-layer tiling.
//Ideally, your stages should rarely need to actually use this script.

                    span-=1;
                    hole[0]=0;
                    for (i=1;i<stretch;i+=1)
                    {
                        hole[i]=0;
                        tile_id=tile_layer_find(1000000,x+i*16,y+span*16);
                        if  !tile_id ||
                        (
                            !(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                        //  &&!(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16)
                        )
                        {
                            hole[i]=1;
                            hole[0]=1;
                        }
                    }
                    if hole[0]=1
                    {
                        while hole[0]=1
                        {
                            image_yscale-=1;
                            span-=1;
                            hole[999]=0;
                            for (i=1;i<stretch;i+=1)
                            {
                                tile_id=tile_layer_find(1000000,x+i*16,y+span*16);
                                if  !tile_id ||
                                (
                                    !(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                                //  &&!(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16)
                                )
                                {
                                    if hole[i]=1
                                        hole[999]=1;
                                }
                            }
                            if hole[999]=0
                                hole[0]=0;
                        }
                    }
                }
            }
        }
    }
}

Note: In the single-layer version, the commented-out line is an example. tile_get_top() and tile_get_left() check the X and Y coordinates of the tile you want to be treated as a solid in the tile sheet. So in the script here, the default solid tiles would be at the very top-left corner of the tile sheet, and the commented sample would be right below it in the tile sheet. As I said, this version requires a bit more editing.

If you have any questions, just message me or Inccubus, since I've been kinda keeping him in the loop during development.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Tags:
 

anything