Topic:   luker   (Read 5765 times)


0 Members and 1 Guest are viewing this topic.

alias


  • Guest
luker
« on: April 08, 2008, 04:15:41 AM »
Its good to lurk is it not? But i figured i'd be more fun to join and let the numerous lurkers read MY posts.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: luker
« Reply #1 on: April 08, 2008, 04:26:56 AM »
Ah, I was wondering when you were gonna register an account. :) How's progress on your game?
I survived the spammage of 2007

alias


  • Guest
Re: luker
« Reply #2 on: April 08, 2008, 07:59:32 AM »
Terrible actually, i got ALOT of the engine done, but it needed AL to add a SPRITETOUCHINGCOLOUR command. And i was dismal at making art in photoshop, so i abandoned it and started trying to learn objective C and other more advanced languages. Im hoping to get a friend to help me with art and i may restart it again.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: luker
« Reply #3 on: April 08, 2008, 09:11:32 AM »
what did you need a spritetouchingcolor command for? cause i can tell you another way to do it. can you post the sourse?

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: luker
« Reply #4 on: April 08, 2008, 12:48:43 PM »
Alias brainstormed that you'd hardly need to program collision at all if there was a spritetouchingcolor command, as you could simply outline every solid obstacle with a slightly lighter/darker shade of grey than the regular bounding box would have. Then have the "wall" script activate whenever an entity collides with the specified color. (designated with hex code)

I pointed out that such a thing would be stiflingly hard to achieve in GM though, as collision is detected based on the file size of documents.
I survived the spammage of 2007

Swamp7hing


  • GMG-er

  • **


  • Posts: 751

  • I come from the swamps.
Re: luker
« Reply #5 on: April 08, 2008, 02:48:34 PM »
Or Al could simply implement layers.

One of said layers could be an small grid that, when any square is clicked on inside of the grid, it is designated "empty" or "full". You can create new types of the "full" category, so only some sprites can cross it. The layer would be hidden and accessible when you want to modify the invisible grid. This would:

A: Allow for more immersive environments - no longer would you see black lines crisscross the world.

B: Allow for simple and effective collision detection - click to place a blockage, like drag-and-drop, if you will

C: Eliminate the need for grid programming and any color coding, thereby simplifying programming of collision based games

Simple enough, if I described it well. Just think photoshop style layers.

GMG Tim


  • Administrator

  • GMG-er

  • *****


  • Posts: 465
Re: luker
« Reply #6 on: April 08, 2008, 02:54:04 PM »
That's how maps are done in RPGs. You have two arrays: one to draw the map, and one to designate boundries, like so.

Code: [Select]
Array 1: D = Dirt, G = Grass

GGGDGGG
GGGDDDG
GGGGGDG
GGGGDDG
DDDDDDD
WWWWWWW

Array 2: X = Boundary

XXXDXXX
XXXDDDX
XXXXXDX
XXXXDDX
DDDDDDD
XXXXXXX
From the first array, you replace the letter with the tile image you want, and in the second array, you see if the player can move to the designated tile. This is why arrays and for loops would be really useful in GameMaker, although I guess you could use a REPEAT loop to cycle through an array.

Ghost
« Last Edit: April 08, 2008, 02:54:50 PM by admin »

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: luker
« Reply #7 on: April 08, 2008, 04:42:55 PM »
That's exactly how collision works in V6:
Code: [Select]
gridlayout$ = "1 1 1 1 1 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 1"

moveXY = 0
moveXY = 7 * moveY
moveXY = moveXY - 7
moveXY = moveXY + moveX
newtile$ = WORD$ gridlayout$ moveXY

IF newtile$ = "0" THEN newtile$ = "empty"
IF newtile$ = "1" THEN newtile$ = "wall"
IF newtile$ = "2" THEN newtile$ = "portal"
Hopefully 4.0 will be able to draw sprites fast enough for the above method to work too.
I survived the spammage of 2007

alias


  • Guest
Re: luker
« Reply #8 on: April 09, 2008, 05:54:50 AM »
I figured sprite colour colide detection would be really useful in NON grid style games (aimed at equanox) i know how to make a tile engine, i have an old one that i though was too clumsy to use that i made back when i first bought game maker (3.3.3)

Yes arrays would help a whole lot, but i think AL should impliment a built in tile engine for less code orientated game makers

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: luker
« Reply #9 on: April 09, 2008, 09:19:06 AM »
Quote
That's how maps are done in RPGs. You have two arrays: one to draw the map, and one to designate boundries, like so.

Code: [Select]
Array 1: D = Dirt, G = Grass

GGGDGGG
GGGDDDG
GGGGGDG
GGGGDDG
DDDDDDD
WWWWWWW

Array 2: X = Boundary

XXXDXXX
XXXDDDX
XXXXXDX
XXXXDDX
DDDDDDD
XXXXXXX
From the first array, you replace the letter with the tile image you want, and in the second array, you see if the player can move to the designated tile. This is why arrays and for loops would be really useful in GameMaker, although I guess you could use a REPEAT loop to cycle through an array.

Ghost
say gamemaker had arrays and a system like that, how would you place characters in specific places on a LARGE map easilly without the x and y grid? the grid system is good for lots of universal things

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: luker
« Reply #10 on: April 09, 2008, 09:29:13 AM »
I think Ghost's grid system still uses X and Y representatives of sprite positions, just not to detect collision. It's pretty much exactly the same way V6 works, only with an array rather than a lengthly variable.
I survived the spammage of 2007