Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Realistic Swing, PhyX_Ch3ck
LordZodiarcheBis...
post Jan 3 2010, 07:19 AM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 112
Type: Developer
RM Skill: Skilled




Description

This script simulates realistic swinging for a ball and chain trap.
I do not recommend to chose negative maxswing-values or values above 90

How to use

Paste the below scripts into an object. (Replace "obj_chain" and "obj_ball") Place the object in your room.
Hold CTRL and rightclick the object. Select "Creation code". Write "maxchains = XX" and "maxswing = XX" (You can put a value on XX)
Optional you can write "dir = XX" to declare a starting angle. Have fun.

create event:
CODE
for(i = 1;i <= maxchains;i+=1)
{
chain[i] = instance_create(x,y+4+i*8,obj_chain)
}
ball = instance_create(x,y+4+i*8,obj_ball)

dir = 0
e = 0
g = 0


step event:
CODE
for(i = 1;i <= maxchains;i+=1)
{
chain[i].x = x+lengthdir_x(4+i*8,-90+dir+i*g)
chain[i].y = y+lengthdir_y(4+i*8,-90+dir+i*g)
}
ball.x = x+lengthdir_x(4+i*8,-90+dir+i*g)
ball.y = y+lengthdir_y(4+i*8,-90+dir+i*g)


e += 1
dir = lengthdir_x(maxswing,e)
g = lengthdir_x(1,e)


__________________________
QUOTE (Harryb412)
Your thread needs to meet these requirements. You have 72 days.
Go to the top of the page
 
+Quote Post
   
darkyoshi
post Jan 3 2010, 11:33 PM
Post #2


o_O
Group Icon

Group: Revolutionary
Posts: 1,244
Type: None
RM Skill: Undisclosed




I checked this out and it works great Bistian. Good job on this. smile.gif
Like you asked in irc, I'll use this. I won't replace the ball and chains in the levels I currently have as the ones that are there are designed specifically for those areas. But I will be using this later.

I do want to clarify something for others using this:

You will need 3 objects: (when he referenced the "obj_chain" and "obj_ball")
A control object.
Chain object.
Ball object.
The script in the first post go in the control object, the others you just need as empty place holders for the ball and chain. You may want to add some interactive elements to the ball, but as far as this script itself is concerned, you only need those 3 objects.


__________________________
Click to go to the Distorted Travesty thread.

Other Stuff

Voted "Best New Member of 2007"


Funny things people say

Pandemikk: "Please don't let your your homosexuality give you biased judgments on a person's artwork." -Source
Phantsmal: "In those times, China and Japan where very much alike. i'd say china because that's where most people knew martial arts,But i dunno." -Source

Normal IRC shenanegans

Some posts here make me feel kinda like this.
Go to the top of the page
 
+Quote Post
   
amaro57
post Jan 4 2010, 05:24 AM
Post #3


Enigmatic Art
Group Icon

Group: Revolutionary
Posts: 825
Type: Developer
RM Skill: Skilled




Thanks for clearing that up Dark. I shall be using this for my project Bistian, surprisingly I found one script I need here in the forums!
I didn't know you used Game Maker...ah well.


__________________________
[Show/Hide] Sig Inside

[Show/Hide] Member Card


Ty Holder :D

[Show/Hide] My UBER Art




[Show/Hide] My Project Logo by Axerax
Still going on Construct Classic. Currently drawing dialogue portraits for the characters. Some can be found on my DA.

Mystery of the Seventh Tower: Reborn
-------------------
[Show/Hide] Progress

------------------------------------
I've got my Platform Engine now. Still have to tweak it a bit to allow the 'action' part xD.
------------------------------------
Running into some errors, I'm trying to fix them up as soon as possible though.
------------------------------------
*Fixed*
Let's go back to tweaking shall we?
------------------------------------
Mega thanks to DarkYoshi for helping me on so many things. I'm understanding things better now. Just need to see how to call on some object states...mmm...
------------------------------------
Coding AI for enemies
------------------------------------
*Project Moves to Construct*
------------------------------------
I've established a deal with Christian Andersson for his music. That guy is a Fantasy Music GOD.
------------------------------------
Contacting several people for pixel work commissions.
------------------------------------
Gathering some more BGs.
------------------------------------
Editing current sprites for use in Construct.
------------------------------------
Waiting for v1 for Construct.
------------------------------------
Finishing Game Flow Design.
------------------------------------
Finished Story, yet to finalize.
------------------------------------
Finished Red and Yellow tower's level design.
------------------------------------
Finished Aeiner's Sky Port design.
------------------------------------
Character Design time.
------------------------------------


A project developed by Ambry. This used to be my old RMXP project but I converted it to GM8 and now Construct due to the game play possibilities. It's an action platformer with RPG elements and slight twists here and there. The project is based on 'The Seventh Tower' series by Garth Nix, but I assure you, I'm changing a lot of things!

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:

 

Lo-Fi Version Time is now: 18th June 2013 - 12:44 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker