User Tag List

Page 3 of 3 FirstFirst 1 2 3
Results 21 to 24 of 24

Thread: Some scripts from Grikarugun.

  1. #21
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Some scripts from Grikarugun.

    Psuedo solidity, coming soon. Useful for moving walls that can crush the player, multiple paths (decide quick!!) in scrolling shooters, and much much more.


    In the meanwhile, these fun little things are used in level 2 by the "tank like" enemies and a wip 'no-tile enemy' boss. Aptly named "Degree_Buster, and Degree_Buster_Buster". Anyone get the reference?

    The first will take a degree, modify it so that it is ten degrees closer to target x,y, and finally return that modified number.

    The second will take a radian value, compare that with target x,y, and return that value with a difference of 1/36th.

    You gotta love flying tanks.

    Code:
    int Degree_Buster(int targetx, int targety, int originx, int originy, int firing_degree){
    
    	int atan = ArcTan(targetx-originx,targety-originy)*(180/PI);
    	while(atan<0)atan+=360;
    	while(firing_degree<0)firing_degree+=360;
    	while(firing_degree>360)firing_degree-=360;
    	if(Abs(firing_degree-atan)>180){
    		if(atan>firing_degree)return (firing_degree-10);
    		else return (firing_degree+10);
    	}
    	else if(Abs(firing_degree-atan)>10){
    		if(atan>firing_degree)return (firing_degree+10);
    		else return (firing_degree-10);
    	}
    	else return atan;
    }
    Code:
    int Degree_Buster_Buster(int targetx, int targety, int originx, int originy, int rad_angle){
    
    	int atan = ArcTan(targetx-originx,targety-originy);
    	if(Abs(rad_angle-atan)>PI){
    		if(atan>rad_angle)return (rad_angle-0.1745);
    		else return (rad_angle+0.1745);
    	}
    	else if(Abs(rad_angle-atan)>0.1745){
    		if(atan>rad_angle)return (rad_angle+0.1745);
    		else return (rad_angle-0.1745);
    	}
    	else return atan;
    }
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #22
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Some scripts from Grikarugun.

    So the second one is just the same, but in radians?

  3. #23
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Some scripts from Grikarugun.

    Quote Originally Posted by Joe123 View Post
    So the second one is just the same, but in radians?
    Yep. They do the same exact thing exept for the type of value you input and they return. ^_^

    I realized after using the first one that I'd need the second to save on space for some other stuff, and for a boss. Betcha can't eat just one!
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #24
    Keese Schwa's Avatar
    Join Date
    Jun 2007
    Age
    36
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    731
    Level
    9
    vBActivity - Bars
    Lv. Percent
    51.63%

    Re: Some scripts from Grikarugun.

    GEEZ, you guys are hardcore! I know enough scripting to get by, but this stuff is overkill... I feel like I don't belong here at AGN... X_X

    I wish I could tell you how great you are, Gleeok, but you lost me a few pages ago...
    --Schwa

    Go here for updates on my Quest project: Molka Elite.
    Here is my first finished Quest: Molka. Ranked with 4.5 stars on PureZC.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social