Game Maker Community YoYo Games

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Charny Scripts, Geometry, Math, Fractions, Movements, ECT... More than 50 scripts!
Charny
post Nov 7 2009, 02:06 AM
Post #1


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Hello, welcome to my scripts thread!


I will add new scripts everyday!

Please, post a comment on this thread if you use one of my scripts.
If you find any bugs with one of my scripts, post it here.

Updates :

I added a GMK with all the scripts.

You can :

- Use my scripts in your game without giving credits
- Post my scripts on another thread or on another forum if you give me the credits and a link to my scripts thread.
- Add things to my scripts nor change them, but you still give me the credits. If you want to get a part of the credits, post the modified script on this thread.

You can't :

- Post one of my scripts on another forum/thread and say that you made it.
- Use my scripts in your game and say that you made it.

The scripts (Download) :



Content :

1- Geometry
- Area
- Total area
- Perimeter
- Volume

2- Geometry (Drawing)
- Shapes
- 3D shapes
- Shape's developpements

3- Math
- Pythagoras
- Variation rate

4- Fractions & decimals
5- Extended functions
6- Others
- Movements
- Following
- ect..


--------------------------------------------------------------------

1. Geometry

Area - These scripts will return the area of a shape.

rhomb_area()

rectangle_area()

triangle_area()

trapezium_area()

parallelogram_area()

polygon_area()

circle_area()

Sector of a disk(area) :

sector_interior()

sector_exterior()

Total area - These scripts will return the total area of a shape.

square_total()

prism_total()

recpyramid_total()

cylinder_total()

cone_total()

sphere_total()

Perimeter - These scripts will return the perimeter of a shape.

rhomb_perimeter()

rectangle_perimeter()

triangle_perimeter()

trapezium_perimeter()

parallelogram_perimeter()

polygon_perimeter()

circle_circumference()


Volume - These scripts will return the volume of a shape.


cylinder_volume()

recpyramid_volume()

trpyramid_volume()

sphere_volume()

prism_volume()

2. Geometry (Drawing)

Shapes - These scripts will draw a shape.

draw_parallelogram()

draw_polygon()


3D shapes - These scripts will draw a 3D shape.

draw_3dpyramid()

draw_3dpyramid2()

draw_3dcone()

draw_3dprism()

draw_3dcylinder()


Shape's developpements - These scripts will draw the developpement of a shape.


dev_pyramid()

dev_cylinder()

dev_prism()


3. Math :


Pythagoras :

pythagoras_hyp()

pythagoras_cat()

Variation rate :

variation_rate()

4. Fractions & decimals:

decimal_to_fraction() This script will change a decimal number to a fraction, without whole number (e.g : 60/30)

decimal_to_fraction_whole() This script will change a decimal number to a fraction, with whole number (e.g : 1 1/15)

fraction_to_decimal() This script will change a fraction to a decimal number.

reduce_fraction() This script will reduce a fraction.

fractions_addition() This script will add a fraction with another fraction.

fractions_subtraction() This script will subtract a fraction to another fraction.

fractions_multiplication() This script will multiply a fraction with another fraction.

fractions_division() This script will divide a fraction to another fraction.


5. Extended functions

instance_create_ext() This script will create an instance with more arguments, speed, alpha, color, direction, angle.

6. Others

Movements :


arrows_movements() With this script, you will be able to move an instance with the arrows keys.

wasd_movements() With this script, you will be able to move an instance with the 'W' 'A' 'S' and 'D' keys.

numpad_movements() With this script, you will be able to move an instance with the numpad keys.

Following :

follow_object()

follow_mouse()


Charny

This post has been edited by Charny: Nov 21 2009, 11:23 PM
Go to the top of the page
 
+Quote Post
CaptainLepidus
post Nov 15 2009, 03:13 PM
Post #2


GMC Member
Group Icon

Group: GMC Member
Posts: 125
Joined: 4-July 09
Member No.: 136001



You realize that everyone of those scripts (with the exception of instance_create_ext(), I don't even know what that is!) is inside my easyGML?
Go to the top of the page
 
+Quote Post
Charny
post Nov 15 2009, 05:46 PM
Post #3


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



I don't care?

And hmmm... I'm currently working on new scripts and libs.
Go to the top of the page
 
+Quote Post
CaptainLepidus
post Nov 16 2009, 04:36 AM
Post #4


GMC Member
Group Icon

Group: GMC Member
Posts: 125
Joined: 4-July 09
Member No.: 136001



I'm just saying, there probably will be competition.
Go to the top of the page
 
+Quote Post
Charny
post Nov 16 2009, 05:44 AM
Post #5


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Hmmm....

Most of the scripts that I made(Which aren't released yet) are based on geometry and math.

wink1.gif
Go to the top of the page
 
+Quote Post
Charny
post Nov 17 2009, 07:44 PM
Post #6


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Ultra Mega BUMP!
Go to the top of the page
 
+Quote Post
millzyman
post Nov 17 2009, 08:05 PM
Post #7


GMC Member
Group Icon

Group: GMC Member
Posts: 707
Joined: 8-August 06
Member No.: 56660



for your follow_object()

*Please note: this is a suggestion... You can use it if you want no credit required*

CODE
if (distance_to_object(argument0)>0)
{
mp_potential_step(argument0.x,argument0.y,argument1,argument2);
}
else
{
speed=0;
}
image_angle=direction


Arguments:
0-object
1-speed
2-Allow mp_potential_step to check for solid or all collisions


mp_potential_step() will allow the object to avoid solid or all (depending on your true and false decision)

I am not trying to undermind you, but hey it could just be for future reference, use as you please (or if you want)


Edit:

I see you updated. You have some alright scripts there. Good to see mate

This post has been edited by millzyman: Nov 17 2009, 08:08 PM
Go to the top of the page
 
+Quote Post
Charny
post Nov 17 2009, 09:37 PM
Post #8


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Thanks wink1.gif. I will credit you for the updated script.
Go to the top of the page
 
+Quote Post
kryptos
post Nov 21 2009, 06:56 PM
Post #9


GMC Member
Group Icon

Group: GMC Member
Posts: 7
Joined: 23-February 05
From: FRANCE
Member No.: 22583



Well. A script without any comments explaining what it is supposed to do is just useless.
Go to the top of the page
 
+Quote Post
Charny
post Nov 21 2009, 07:00 PM
Post #10


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Hmmm.... the name explains what the script is doing... but if you want, I can say what the scripts are doing.

Go to the top of the page
 
+Quote Post
kryptos
post Nov 21 2009, 09:47 PM
Post #11


GMC Member
Group Icon

Group: GMC Member
Posts: 7
Joined: 23-February 05
From: FRANCE
Member No.: 22583



Actually the name of a script never said what it is really doing except for the creator of that script. Because you know it, you have the false impression the name just fit. But people does not think the same way.
It is the reason why there are always documentation with API, libraries or components. Because the name of a script/function/class, although necesary and useful, doesn't tell everything.

For example, when I first see the script instance_create_ext, I had no idea what I was about. More precisely I had several completely different ideas. And when I read the script, I realized that none of them was what the script really does.

This post has been edited by kryptos: Nov 21 2009, 09:47 PM
Go to the top of the page
 
+Quote Post
Charny
post Nov 21 2009, 10:38 PM
Post #12


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Ok... I see. I updated the thread. I added a description for most of the scripts.
Go to the top of the page
 
+Quote Post
Charny
post Nov 28 2009, 05:31 AM
Post #13


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Bump...
Go to the top of the page
 
+Quote Post
Charny
post Nov 30 2009, 05:46 AM
Post #14


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



BuMp

Post comments & suggestions please sad.gif
Go to the top of the page
 
+Quote Post
voltain
post Dec 2 2009, 08:13 PM
Post #15


V.C.G
Group Icon

Group: GMC Member
Posts: 168
Joined: 10-October 08
From: UK
Member No.: 116947



I'm pretty sure you could have shortened half of these scripts. For example decimal_to_fractions

CODE
var xx,yy,decimal,number,sur,fraction,i;
decimal = string(argument1);
number = string_length(decimal);
fraction = power(10,number);
sur = argument1+(argument0*fraction);
xx = sur;
yy = fraction;
i=0;

if (argument2)
{
    for (i=2; i<10;i+=1;)
        {
            while (xx mod i)=0 && (yy mod i)=0
                {
                 xx = xx/i;
                 yy = yy/i;
                 }
        }
}
return string(xx)+"/"+string(yy)


Your version (excluding commenting) is about 8 times longer than the one above. The scripts are okay but one of the best trait's of a good programmer is being able to make code as short and efficient as possible. In fact I think that someone more advanced than me could make this shorter. Also try to indent your work because it makes it easier to read.

Go to the top of the page
 
+Quote Post
Charny
post Dec 3 2009, 01:21 PM
Post #16


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Ok, thanks. I will fix them.
Go to the top of the page
 
+Quote Post
Charny
post Dec 15 2009, 10:06 PM
Post #17


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



BUMP
Go to the top of the page
 
+Quote Post
gmx0
post Dec 26 2009, 06:32 PM
Post #18


GMC Member
Group Icon

Group: GMC Member
Posts: 447
Joined: 26-May 06
Member No.: 50793



finally more math scripts!
Go to the top of the page
 
+Quote Post
Charny
post Dec 27 2009, 01:44 AM
Post #19


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Thanks ;D
Go to the top of the page
 
+Quote Post
Charny
post Jan 6 2010, 07:02 PM
Post #20


Charny Games
Group Icon

Group: GMC Member
Posts: 444
Joined: 16-August 09
From: Québec
Member No.: 138113



Bump
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 9th February 2010 - 04:48 PM