Archiv verlassen und diese Seite im Standarddesign anzeigen : Jump . Script gesucht (XP)
Dragenai
11.11.2008, 12:41
Hey ,
Ich suche ein JumP Script für den XP man soltle mit der Leertaste immer 1 Schritt nach vorne springen , es soll ermöglichen auch auf Tische usw zu springen ..
Dann suche ich nochmal ein Jump Script was dem Hauptchar ermöglicht richtig hoch zu springen aber dafür muss er mp , oder Geld opfern ^^ also mp , Goldstücke ..#
Belohnung : Creditseintrag + Gastrolle ..
dir werden nicht mehr viele leute helfen.
Wir alle wissen ja sowieso, das du es canzeln wirst.
Aber nagut, hier ist es...
conditional branch[cb] if key a is pressed
--wait 1 frames
--cb if key a is pressed
----move event:hero jump -10x
--
conditional branch[cb] if key c is pressed
--wait 1 frames
--cb if key c is pressed
----move event:hero jump -1x
--
Das ist nur für springe hoch...
Damit du die sachen abtrennen kannst, brauchst du ein anderes cb.
legende:
cb = conditional branch
Shining Advances
11.11.2008, 13:50
geht wie adrian scho gesagt hat auch mit events...allerdings dürfts mit den tischen etc schwierig werden...
habs ma mit rgss versucht. hoffe es is wie du es dir vorstellst.
ist aber ohne den großen sprung.
tische etc wo man drauf springen können soll müssen terrain 7 haben.
springen tut man allerdings nicht nur bei der leertaste sondern auch bei enter.
edit: habs nochmal überarbeitet
$kurz is die normale sprung weite
$ lang für den langen sprung der mp kostet
$kosten gibt die mana kosten an
den langen sprung macht man mit strg
$kurz = 1
$lang = 4
$kosten = 50
class Game_Player
def jump(x_plus, y_plus)
# If plus value is not (0,0)
if x_plus != 0 or y_plus != 0
# If horizontal distnace is longer
if x_plus.abs > y_plus.abs
# Change direction to left or right
x_plus < 0 ? turn_left : turn_right
# If vertical distance is longer, or equal
else
# Change direction to up or down
y_plus < 0 ? turn_up : turn_down
end
end
# Calculate new coordinates
new_x = @x + x_plus
new_y = @y + y_plus
# If plus value is (0,0) or jump destination is passable
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0) or $game_map.terrain_tag(new_x,new_y) == 7
# Straighten position
straighten
# Update coordinates
@x = new_x
@y = new_y
# Calculate distance
distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
# Set jump count
@jump_peak = 10 + distance - @move_speed
@jump_count = @jump_peak * 2
# Clear stop count
@stop_count = 0
end
end
def update
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
if Input.trigger?(Input::C)
case @direction
when 2
jump(0,$kurz)
when 4
jump(-$kurz,0)
when 6
jump($kurz,0)
when 8
jump(0,-$kurz)
end
elsif Input.trigger?(Input::CTRL)
$game_party.actors[0].sp -= $kosten
case @direction
when 2
jump(0,$lang)
when 4
jump(-$lang,0)
when 6
jump($lang,0)
when 8
jump(0,-$lang)
end
else
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
end
# Remember coordinates in local variables
last_real_x = @real_x
last_real_y = @real_y
super
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# Scroll map down
$game_map.scroll_down(@real_y - last_real_y)
end
# If character moves left and is positioned more let on-screen than
# center
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# Scroll map left
$game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than
# center
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# Scroll map right
$game_map.scroll_right(@real_x - last_real_x)
end
# If character moves up and is positioned higher than the center
# of the screen
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# Scroll map up
$game_map.scroll_up(last_real_y - @real_y)
end
# If not moving
unless moving?
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event
result = check_event_trigger_here([1,2])
# If event which started does not exist
if result == false
# Disregard if debug mode is ON and ctrl key was pressed
unless $DEBUG and Input.press?(Input::CTRL)
# Encounter countdown
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# If C button was pressed
if Input.trigger?(Input::C)
# Same position and front event determinant
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
Dragenai
11.11.2008, 14:01
DANKE SHINING !!! http://www.multimediaxis.de/images/smilies/old/sm_12.gifhttp://www.multimediaxis.de/images/smilies/old/sm_12.gifhttp://www.multimediaxis.de/images/smilies/old/sm_12.gifhttp://www.multimediaxis.de/images/smilies/old/sm_12.gifhttp://www.multimediaxis.de/images/smilies/old/sm_12.gifhttp://www.multimediaxis.de/images/smilies/old/sm_12.gif
Creditseintrag + Gastrolle
Wie willst du im Spiel heißen ?
is klar das ich nich gleich einbaun kann .. aber wird schon ^^
DIR AUCH ADRIAN das klappt mit hoch !
Powered by vBulletin® Version 4.2.3 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.