Quote: You must be refreshing just to see a funny quote...
blade2k » articles & tutorials

jump to:
Tutorials » Game Creation » RPG Maker 200x

ABS:: shoot funtion (and a little about sword)


Reading Article
Author: basaah
Posted on 08/23/2004
print :: back to list
here you can learn how to make an shoot funtion, and there is a little about sword slash

w

ow cool that you read this , cause here I describe how to make a shoot function, one whit a bow a gun alaser beam a pistel, whatever, it's writen here::



step 1: make an animation for the bullet, make four of them one up one down one left and right, just pick up an battle animation grapchic whit an round in it, then make it, use the hero as start point,


step 2: make the map, and make the enemies, let's start whit one, make an event in your map (and the hero start position) call the event monster 1 , make it move toward hero or something en when thouch the hero the hero lost a live and bounches back or something, well anyway make another page
and the trigger should be something like varrible: monster one hit's are 5 (or more or lessthen that) and in this page there should be no monster picture anymore it is dead jeeh

------------here start's the real code------------------------(do not make it in comman event)

step 3: make an new event in the corner or something transparent, and parralel procses, then use this code


<>enter password: (use the key you prefer, en set wait til pressed)(and set it in a varible)

<>fork: (when the varible of above is (the number of the key you prefer)

<><> fork: event hero is facing up,
<><><> show battle animation, wapaen 1 up target hero
<><><> wait (as long if you want (0.1 is good)(how slower the bullet of the wapean goes how more wait)
<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> fork: var: hero X is equil to monster 1 X
<><><><>fork: var hero Y is above monster 1 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 hit’s + 1

<><> fork: event hero is facing down,
<><><> show battle animation, wapaen 1 down,, target hero
<><><> wait (as long if you want (0.1 is good)(how slower the bullet of the wapean goes how more wait)
<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> fork: var: hero X is equil to monster 1 X
<><><><>fork: var hero Y is less monster 1 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 hit’s + 1

<><> fork: event hero is facing left,
<><><> show battle animation, wapaen 1 left,, target hero
<><><> wait (as long if you want (0.1 is good)(how slower the bullet of the wapean goes how more wait)
<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> fork: var: hero Y is equil to monster 1 Y
<><><><>fork: var hero X is above monster 1 X
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 hit’s + 1


<><> fork: event hero is facing right
<><><> show battle animation, wapaen 1 right,, target hero
<><><> wait (as long if you want (0.1 is good)(how slower the bullet of the wapean goes how more wait)
<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> fork: var: hero Y is equil to monster 1 Y
<><><><>fork: var hero X is less monster 1 X
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 hit’s + 1


-------------------------------------------------------------------------------------that’s the code -------

did I already sad to make that event parrelel prosces,



step 3 extra: if you want to make more monster you have to code a little more (well let’s
say paste, here is the code of the facing up whit two monster(you have to make an new monster event


<><> fork: event hero is facing up,
<><><> show battle animation, wapaen 1 up target hero
<><><> wait (as long if you want (0.1 is good)(how slower the bullet of the wapean goes how more wait)
<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> change var:: monster 2 X set equil to event, monster 2 X
<><><> change var:: monster 2 Y set equil to event, monster 2 Y
<><><> fork: var: hero X is equil to monster 1 X
<><><><>fork: var hero Y is above monster 1 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 hit’s + 1
<><><> fork: var: hero X is equil to monster 2 X
<><><><>fork: var hero Y is above monster 2 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 2 hit’s + 1


make this copy in all four shoot directions


you can use this for an Abs (it already is)
but you can also make a sword function very simple.


The code to the up should then be like this

<><><> memorize position in var hero id,, hero X and hero Y
<><><> change var:: monster 1 X set equil to event, monster 1 X
<><><> change var:: monster 1 Y set equil to event, monster 1 Y
<><><> change var:: monster 2 X set equil to event, monster 2 X
<><><> change var:: monster 2 Y set equil to event, monster 2 Y
<><><>change var:: monster 1 Y + 1
<><><>change var:: monster 2 Y + 1
<><><> fork: var: hero X is equil to monster 1 X
<><><><>fork: var hero Y is equil monster 1 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 1 sword hit’s + 1
<><><> fork: var: hero X is equil to monster 2 X
<><><><>fork: var hero Y is equil monster 2 Y
<><><><><> play sound Bloodsuck
<><><><><> change var: monster 2 sword hit’s + 1

and know you can use your sword againts monster 1 and 2 when you are facing up, (if you still don’t understand the code BMS basaah,



if you use this toturial on an other site give credit to basaah,