|
Zelda
Apr 5, 2022 8:13:47 GMT -5
Post by atomose on Apr 5, 2022 8:13:47 GMT -5
hey ! You should show my project. I think this can really help you =) i will post a new version with sprites and animations  . ' Creat By Atomose Studio 2022 with LibertyBasic 4.51 pro ' Q-S-D-Z for azerty OR arrows ' W-A-D-Z for qwerty OR arrows
nomainwin dim p(x,y) : global dy,dx : WindowWidth = 1620 : WindowHeight = 920 : UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2) : x= 90 : y= 60 : valIniX = 19 : valIniY = 10 : perso1x = 27 : perso1y = 15 : ennemi1x = 36 : ennemi1y = 17 : ennemi2x = 41 : ennemi2y = 25 : ennemi3x = 19 : ennemi3y = 33 : ennemi4x = 50 : ennemi4y = 40 : ennemi5x = 55 : ennemi5y = 30 graphicbox #main.map, 0+10, 0+10, WindowWidth-20, WindowHeight-20 open "Open World RPG 4.2" for window_popup as #main #main, "trapclose [quit]" #main.map, "setfocus; down; fill lightgray; when leftButtonDown [close]"
' map du jeu ou les 0 représentent les zones ou l'ont peut marcher redim p(x,y) data 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 data 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 data 3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,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3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 data 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 for b=0 to y-1 for a=0 to x-1 read valeur : p(a,b)= valeur next a next b
[endLEVEL] #main.map, "discard" timer 0
' mouvements des ennemis , 4 possibilitées pour 4 directions avec conditions de detections d'obstables ennemi1moove = int(rnd(1)*10+1) select case ennemi1moove case 1 if p((ennemi1x+1),(ennemi1y)) = 0 and ennemi1x <88 then ennemi1x = ennemi1x + 1 case 2 if p((ennemi1x-1),(ennemi1y)) = 0 and ennemi1x >2 then ennemi1x = ennemi1x - 1 case 3 if p((ennemi1x),(ennemi1y+1)) = 0 and ennemi1y <58 then ennemi1y = ennemi1y + 1 case 4 if p((ennemi1x),(ennemi1y-1)) = 0 and ennemi1y >2 then ennemi1y = ennemi1y - 1 end select ennemi2moove = int(rnd(1)*10+1) select case ennemi2moove case 1 if p((ennemi2x+1),(ennemi2y)) = 0 and ennemi2x <88 then ennemi2x = ennemi2x + 1 case 2 if p((ennemi2x-1),(ennemi2y)) = 0 and ennemi2x >2 then ennemi2x = ennemi2x - 1 case 3 if p((ennemi2x),(ennemi2y+1)) = 0 and ennemi2y <58 then ennemi2y = ennemi2y + 1 case 4 if p((ennemi2x),(ennemi2y-1)) = 0 and ennemi2y >2 then ennemi2y = ennemi2y - 1 end select ennemi3moove = int(rnd(1)*10+1) select case ennemi3moove case 1 if p((ennemi3x+1),(ennemi3y)) = 0 and ennemi3x <88 then ennemi3x = ennemi3x + 1 case 2 if p((ennemi3x-1),(ennemi3y)) = 0 and ennemi3x >2 then ennemi3x = ennemi3x - 1 case 3 if p((ennemi3x),(ennemi3y+1)) = 0 and ennemi3y <58 then ennemi3y = ennemi3y + 1 case 4 if p((ennemi3x),(ennemi3y-1)) = 0 and ennemi3y >2 then ennemi3y = ennemi3y - 1 end select ennemi5moove = int(rnd(1)*10+1) select case ennemi5moove case 1 if p((ennemi5x+1),(ennemi5y)) = 0 and ennemi5x <88 then ennemi5x = ennemi5x + 1 case 2 if p((ennemi5x-1),(ennemi5y)) = 0 and ennemi5x >2 then ennemi5x = ennemi5x - 1 case 3 if p((ennemi5x),(ennemi5y+1)) = 0 and ennemi5y <58 then ennemi5y = ennemi5y + 1 case 4 if p((ennemi5x),(ennemi5y-1)) = 0 and ennemi5y >2 then ennemi5y = ennemi5y - 1 end select
ennemi4moove = int(rnd(1)*5+1) select case ennemi4moove case 1 if p((ennemi4x+1),(ennemi4y)) = 0 and ennemi4x <88 then ennemi4x = ennemi4x + 1 case 2 if p((ennemi4x-1),(ennemi4y)) = 0 and ennemi4x >2 then ennemi4x = ennemi4x - 1 case 3 if p((ennemi4x),(ennemi4y+1)) = 0 and ennemi4y <58 then ennemi4y = ennemi4y + 1 case 4 if p((ennemi4x),(ennemi4y-1)) = 0 and ennemi4y >2 then ennemi4y = ennemi4y - 1 end select
' boucle qui génère la map for y=int(0+valIniY) to int(valIniY+9) ' pion a atteindre pour gagner #main.map, "size 80;color green" #main.map, "set ";int(((ennemi4x-valIniX)*100)+50);" ";int(((ennemi4y-valIniY)*100)+50) ' personnage #main.map, "color cyan" #main.map, "set ";int((WindowWidth/2))+40;" ";int((WindowHeight/2)-50)+140 ' ennemis #main.map, "color red" #main.map, "set ";int(((ennemi1x-valIniX)*100)+50);" ";int(((ennemi1y-valIniY)*100)+50) #main.map, "set ";int(((ennemi2x-valIniX)*100)+50);" ";int(((ennemi2y-valIniY)*100)+50) #main.map, "set ";int(((ennemi3x-valIniX)*100)+50);" ";int(((ennemi3y-valIniY)*100)+50) #main.map, "set ";int(((ennemi5x-valIniX)*100)+50);" ";int(((ennemi5y-valIniY)*100)+50) : #main.map "size 1" ' case fermeture du jeu #main.map, "color yellow; backcolor black; place ";int(WindowWidth-90);" ";10;"; boxfilled ";int(WindowWidth-90)+50;" ";60 for x= int(0+valIniX) to int(valIniX+16) select case p(x,y) case 0 ' terrain accecible #main.map, "color lightgray; backcolor lightgray; place ";valX;" ";valY;"; boxfilled ";valX+100;" ";valY+100 case 1 ' murs #main.map, "color black; backcolor darkgray; place ";valX;" ";valY;"; boxfilled ";valX+100;" ";valY+100 case 2,3,4 ' textures en dehors des limites #main.map, "color blue; backcolor blue; place ";valX;" ";valY;"; boxfilled ";valX+100;" ";valY+100 end select valX = valX + 100 next valX = 0 : valY = valY + 100 next valX = 0 : valY = 0
' condition de victoire ou de défaite if (ennemi1x = perso1x and ennemi1y = perso1y) or (ennemi2x = perso1x and ennemi2y = perso1y) or (ennemi3x = perso1x and ennemi3y = perso1y) or (ennemi5x = perso1x and ennemi5y = perso1y) then notice " " + chr$(13) + "Game Over" : close #main : end if (ennemi4x = perso1x and ennemi4y = perso1y) then notice " " + chr$(13) + "Victory !" : close #main : end
' commandes qui interprete les touches du joueur (déplacement) dx = 0 : dy = 0 : call readJStick 1 : if dy <> 0 then dx = 0 valIniX = valIniX+(1*dx) : perso1x = perso1x +(1*dx) : valIniY = valIniY+(1*dy) : perso1y = perso1y +(1*dy)
select case p(perso1x,perso1y) case 1 if dx = -1 then dx = 0 : valIniX = valIniX +1 : perso1x = perso1x +1 if dx = 1 then dx = 0 : valIniX = valIniX -1 : perso1x = perso1x -1 if dy = 1 then dy = 0 : valIniY = valIniY -1 : perso1y = perso1y -1 if dy = -1 then dy = 0 : valIniY = valIniY +1 : perso1y = perso1y +1 end select
timer 60, [endLEVEL] : wait
[close] mX = MouseX : mY = MouseY if mX > int(WindowWidth-90) and mX < int(WindowWidth-90)+50 and mY > 10 and mY < 60 then goto [quit] wait [quit] timer 0 : close #main : end
' les deux fonctions ci dessous sont a utiliser avec le call pour avoir un déplacement avec les touches sans délais
function GetAsyncKeyState(key) calldll #user32, "GetAsyncKeyState",key as long,GetAsyncKeyState as long if GetAsyncKeyState<>0 then GetAsyncKeyState=1 end function
sub readJStick n if GetAsyncKeyState(asc("Z")) or GetAsyncKeyState(_VK_UP) then dy = -1 if GetAsyncKeyState(asc("W")) or GetAsyncKeyState(_VK_UP) then dy = -1 if GetAsyncKeyState(asc("S")) or GetAsyncKeyState(_VK_DOWN) then dy = 1 if GetAsyncKeyState(asc("Q")) or GetAsyncKeyState(_VK_LEFT) then dx = -1 if GetAsyncKeyState(asc("A")) or GetAsyncKeyState(_VK_LEFT) then dx = -1 if GetAsyncKeyState(asc("D")) or GetAsyncKeyState(_VK_RIGHT) then dx = 1 end sub
|
|