Spacetug and Shape Shifter
Please I will NOT COPY THEM like anyone else might do that there has been discussions on. I promise i will not rename them and take credit. I will though get some learning out of it and maybe beable to put it to use. The reason I ask for specificly these games is because I have no clue how some of the things are done in them. Plz plz plz!!!
Air King
ID:274308
Nov 23 2001, 3:26 pm
|
|
You can post in the "Design Philosophy" board asking for pointers on how to do those "things" that you have no clue how to do. You won't get the exact code but some very good tips on how to make the code yourself.
You gotta learn how to program sometime. |
Air _King wrote:
Shape Shifter Sure! I charge a non-negotiable fee of $100,000 per person who will see the code, per year. I accept cash or money order, but BYONDimes are preferred (remember, that's a million BDs). If this pricing does not fit your budget, perhaps you'll find Evilkevkev's suggestion more economical. Pricing for that plan varies, but is generally the same flat fee for everyone. <font color=black>($0.00)</font> |
In response to Air Mapster
|
|
Air Mapster wrote:
Air _King wrote: Ok ok, can you tell me this then since what you made is also called Diamond Mine and Bejewled: How did you get the shapes to be deleted if they were the same thing in a row? |
In response to Air _King
|
|
Air _King wrote:
Ok ok, can you tell me this then since what you made is also called Diamond Mine and Bejewled: Don't forget Pirate Gems. How did you get the shapes to be deleted if they were the same thing in a row? Easy. Each shape is an object of type /obj/shape. The types of shapes are simply differentiated by different icon_states. The red ball has icon_state "red", the blue pyramid has icon_state "blue" and so on. When a shape moves, it checks all of the adjacent shapes in every direction to see if there are 3 or more in a row that have the same icon_state. I use a slick combination of get_step, some loops, and a list. I have a proc called CheckDir, which checks all of the shapes in a given direction (NORTH, SOUTH, EAST or WEST) from the shape in question. To do that, I need to setup a while loop. Each time in the loop, I get the next turf in the direction I'm looking by called get_step(turf, dir) from the current turf. Once I get the next turf, I look at the shape inside it. If the icon_state of that shape equals the icon_state of the original shape, I add it to my list of matching shapes. If not, then I know I can quit looking, so I get out of the while loop. Pseudocode might look like this: obj/shape/proc/CheckDir(direction) But that was only one direction. So I call CheckDir on the opposite direction - because what if there was one shape of the same color on each side of the one I'm interested in? I have to find both of them. So, for horizontal matches, I do something like this: matchlist += src.CheckDir(EAST) Same kind of thing for NORTH and SOUTH. |
FIREking
p.s. Why does everyone think they can have the source code? Go ask bill gates if you can have the source to windows, and tell me what he says.