Hi there I want to make Maple Story Type of Game in Darkbasic as a requirement for our Thesis Here is my work so far
Gosub Setup
Do
Rem Lines of main program here
wait 20
cls
Anim = 0
Gosub Sprites
Gosub PlayerMovement
Gosub PlayerAnim
Gosub PlayerBoundaryCheck
Gosub PlayerJump
Gosub MonsterAnimation
Sync
Loop
End
Rem ***********************
Rem List of subroutines start here
Rem ***********************
Rem This routine sets up the program
Setup:
Set Display Mode 800,600,32
Gosub LoadImages
Sync on: Sync rate 0
monster_health = 1000
background# = 0
Jumpin = 0
attack = 10
monster = 8
monsterAnim = 1
Player_X# = 10
Player_Y# = screen height() - 175
JUMPING# = screen height() - 175
xmonster# = 250
ymonster# = screen height() - 175
xmonsterattack# = 250
Anim = 0
fRight = 0
Frame = 0
imgNum = 1
Set image colorkey 0, 0 ,0
Return
LoadImages:
load image "Media/Tunstal_Walk_1.png",1
load image "Media/Tunstal_Walk_2.png",2
load image "Media/Tunstal_Walk_3.png",3
load image "Media/Tunstal_Walk_4.png",4
load image "Media/First_Map.png",5
load image "Media/Voda_Dwarf1.png",8
load image "Media/Voda_Dwarf2.png",9
load image "Media/Voda_Dwarf3.png",10
load image "Media/Voda_Dwarf4.png",11
load image "Media/Voda_Dwarf5.png",12
load image "Media/Voda_Dwarf6.png",13
load image "Media/Voda_Dwarf_Attack1.png",14
load image "Media/Voda_Dwarf_Attack2.png",15
load image "Media/Voda_Dwarf_Attack3.png",16
load image "Media/Voda_Dwarf_Attack4.png",17
load image "Media/Voda_Dwarf_Attack5.png",18
load image "Media/Dwarf_Beam.png",19
load image "Media/Tunstal_Attack_1.png",20
Return
Sprites:
Sprite 1, Player_X#, Player_Y#, imgNum
REM Sprite 2, GwanX#,GwanY#, GwanImageNumber
Sprite 3, xmonster#,ymonster#, monster
if monster_health>0
text xmonster#+20, ymonster# , str$(monster_health)
endif
Sprite 4, background#, screen height()-d, 5
set sprite priority 1,1
set sprite priority 3,1
a = SPRITE X(1)
b = SPRITE X(3)
c = abs(a - b)
d = sprite height(4)
e = sprite height(1)
Return
PlayerMovement:
if rightkey() = 1
if Player_X# > (screen width()/2) = 1
background# = background# -2
xmonster# = xmonster# - 2
xmonsterattack# = xmonsterattack# - 2
endif
if controlkey() = 1
Player_X# = Player_X# + 4
Endif
Player_X# = Player_X# +4
if fRight = 0
Mirror Sprite 1
fRight = 1
Endif
Anim = 1
Endif
if downkey() = 1
endif
if leftkey() = 1
if Player_X# < (screen width()/2) = 1
background# = background# +2
endif
if controlkey() = 1
Player_X# = Player_X# -4
Endif
Player_X# = Player_X# -4
if fRight = 1
Mirror Sprite 1
fRight = 0
Endif
Anim = 1
Endif
if scancode() = 30
Anim = 2
attackdamage = 10
attack$ =str$(attackdamage)
PRINT a," ",b, " " ,c ," ", Jumpin
if c>0 and c<85 and Player_Y# =screen height() - 175 = 1
if monster_health>0
text xmonster# + 20, ymonster# -20, attack$
monster_health = monster_health - val(attack$)
endif
endif
endif
if spacekey() = 1
Player_Y# = Player_Y# - 25
Jumpin = 1
endif
Return
PlayerJump:
if Jumpin = 1
Player_Y# = Player_Y# + 5
endif
if Player_Y# = screen height() - 175 = 1
Jumpin = 0
endif
return
PlayerAnim:
If Anim = 2
imgNum = 20
else
imgNum = 1
If Anim = 1
imgNum = 2 + (Frame/3)
Frame = Frame + 1
If Frame > 4 Then Frame = 1
Else
imgNum = 1
Endif
endif
Return
PlayerBoundaryCheck:
if Player_X# < 0
Player_X# = 0
endif
if Player_X# > screen width() - sprite width(1)
Player_X# = screen width() - sprite width(1)
Endif
if Player_Y# < 0
Player_Y# = 0
endif
if Player_Y# > screen height() - sprite height(1)
Player_Y# = screen height() - sprite height(1)
Endif
if c<40 and Player_Y# = 377 =1
if c<40
Player_X# = a+1
endif
endif
if c<48 and Player_Y# = 377 =1
if c<48
Player_X# = Player_X#-1
endif
endif
Return
MonsterAttackAnimation:
If attack = 10
monster = 14
endif
return
MonsterAnimation:
print abs(xmonsterattack# - Player_X#)
print xmonsterattack#
if monster_health > 0
if c < 150
monsterAnim = 2
if monsterAnim = 2
monster = 14
Sprite 3, xmonster#,ymonster#, monster
if monster = 14
sprite 5,xmonsterattack#,ymonster#,19
endif
if sprite collision(5,1)
hide sprite 5
xmonsterattack# = xmonster#
show sprite 5
endif
if monster <> 14
delete sprite 5
endif
if sprite collision(5,1)
text Player_X#,Player_Y#+10,"100"
endif
if Player_X#>xmonster#
xmonsterattack# = xmonsterattack# + 3
else
xmonsterattack# = xmonsterattack# -3
endif
endif
endif
if c >200
monsterAnim = 1
endif
If monsterAnim = 1
monster = 8 + (Frame/2)
if Player_X#>xmonster#
xmonster# = xmonster# + 1
else
xmonster# = xmonster# - 1
endif
Frame = Frame + 1
If Frame > 4 Then Frame = 1
Else
monster = 8
Endif
endif
if monster_health = 0
delete sprite 3
if sprite exist(5) then delete sprite 5
endif
Return
Monster_Respawn:
While sprite exist(1) = 1
loop
return
Rem *********************
Rem List of functions start here
Rem *********************
My Problem is that how to display monsters in the screen and store character stats and monster stats. And Please tell me if you have something to suggest me (ex. tutorial) Thank you. All the help is much appreciated. I really need to do this to complete my Degree. Thank you