Készíttetem egy amatõr bénácska RPG-t, de vannak vele problémák.
Tudom itt nincsenek DBP-sok, de ti még így is könnyebben megfogjátok érteni mint én.
Probléma 01:Nem tudok saját karaktereket megfelelõen beilleszteni a programba, kénytelen voltam kovkákat és gömböket kreálni helyettük.
Így kell beadni egy karaktert:
----------------------------------
tifa=1 : Load object "tifa.x",tifa
Scale object tifa,30,20,35
load image "tifatextura.bmp",tifa
-----------------------------------
Probléma 02:joystick használat, tudom, hogy kell rávenni a programot a joy használatára 2d-s hülyeségeknél mûködik is, de ha itt hozzáadom a programhoz az egész képernyõ ki kékül indításkor.
Így kell használni:
-----------------------------------
if joystick up()=1 then y=y-1
if joystick down()=1 then y=y+1
if joystick left()=1 then x=x-1
if joystick right()=1 then x=x+1
-----------------------------------
----------
A kód:
----------
------------------------------------
Rem Project: RPG
Rem Created: 2009.05.23. 12:46:25
Rem ***** Main Source File *****
REM RGBRPG,
REM DarkBasicPro
Type Character
Rage as Float
Grace as Float
Brains as Float
MaxHP as Float
HP as Float
Money as Float
Level as Float
XP as Float
Name as String
Object as Integer
EndType
Global Player as Character
Type Baddie
Rage as Float
Grace as Float
Brains as Float
HP as Float
XPDrop as Integer
MoneyDrop as Integer
Name as String
Object as Integer
Endtype
Dim Enemies(10) as Baddie
global Fighting as Integer
sync on: sync rate 60
randomize timer()
FirstTimeThrough = 0
Player.Object = 1
Fighting = 0
global Loopy as integer
global Attack as integer
Loopy = 400
Global AttackName$ as String
global DamageFloat as Integer
global Combatant as Integer
global damage as Integer
global FloatTime as Integer
Do
if FirstTimeThrough = 0
NameCharacter() `asks player for a name, keeps it.
StatCharacter() `creates random stats and either rerolls or keeps.
GenerateBaddie() `Might work.
MakeCube() `makes our player object, colours it etc.
MakeWorld() `creates the floor plain, lights etc.
MakeLevel() `generates the buildings/walls of our environment
MakeFloater() `Make the plain that shows damage.
FirstTimeThrough = 1
sync on
endif
if Fighting =0
CubeMovement() `controls the movement of our cube character. WASD keys.
Endif
ThirdPerson() `positions the camera in a 3rd-person style position.
DrawStats()
if Object Collision(1,0)>49
if Object Collision(1,0)<100
Combatant = Object Collision(1,0)-50
DrawBaddieStats()
DoFight()
endif
endif
if Player.XP>100*Player.Level
Level()
endif
if DamageFloat>0
FloatTime=250
DamageFloat = 0
endif
DamageFloater()
Sync
Loop
Function NameCharacter()
sync off
`Now, create our character.
CLS
Set Cursor 0,0
Input "Enter your cube's name:",Player.Name
Print
Print "Welcome ";Player.Name;" the Cube."
Wait 1000
Endfunction
Function StatCharacter()
do
Cls
Set Cursor 0,0
Print Player.Name;", press [R] to re-roll stats, or [Y] to accept stats."
Print
`100 stat points initially. Previous method sometimes resulted in Brains=-1 (ironic, really)
`So we've set a 'points left' and made sure each stat is always at least 1.
Player.Rage=1
Player.Grace=1
Player.Brains=1
AmountLeft=97
Player.Rage=Player.Rage+rnd(AmountLeft)
AmountLeft=AmountLeft-Player.Rage+1
Player.Grace=Player.Grace+rnd(AmountLeft)
AmountLeft=AmountLeft-Player.Grace+1
Player.Brains=Player.Brains+AmountLeft
Player.HP=Player.Rage+Player.Grace+Player.Brains
Player.MaxHP=Player.HP
Player.Money=(Player.Brains+Player.Grace)*2
Player.Level=1
`Still not got a good name or system for assigning the main unit of 'barter'. Depends.
`Print out the stats - note, Rage, Grace, and Brains correspond to Red, Green and Blue
`respectively. This will help people figure out the relative skills of an enemy, etc.