Creare Videogiochi - Game Developer
Piazzare un arma in primo piano - Versione stampabile

+- Creare Videogiochi - Game Developer (https://www.making-videogames.net/giochi)
+-- Forum: Altri Programmi per la Creazione di Videogames (https://www.making-videogames.net/giochi/Forum-Altri-Programmi-per-la-Creazione-di-Videogames)
+--- Forum: Darkbasic Pro, DarkGDK (https://www.making-videogames.net/giochi/Forum-Darkbasic-Pro-DarkGDK)
+--- Discussione: Piazzare un arma in primo piano (/thread-Piazzare-un-arma-in-primo-piano)



Piazzare un arma in primo piano - Jonathan Archer - 14-08-2010

In pure stile fpsc. Qualcuno ha i codici? Smile


RE: Piazzare un arma in primo piano - steve - 14-08-2010

(premesso che non conosco per niente il darkbasic)
non basta mettere la telecamera dietro l'arma? (provando un pò di cooridnate)


RE: Piazzare un arma in primo piano - VisualJump3D - 15-08-2010

Ciao , ti ho trovato del codice sul forum di TGM. ( per DbPro )



il link e' questo :
http://forum.thegamecreators.com/?m=forum_view&t=168485&b=1

il codice :
autocam off:hide mouse
create bitmap 1,50,50:for i= 1 to 1550:ink rgb(30,255,55),0:line rnd(60),i,i,rnd(130)
next i:blur bitmap 1,6:get image 1,10,10,50,50:delete bitmap 1

sync on
arma=20 //gun
bala=21 //bullet
make object box 1,3000,1,3000
texture object 1,1
scale object texture 1,3,3

make object box arma,1,1,10
make mesh from object 1,arma
make object cylinder 100,18
make mesh from object 2,100
delete object 100

add limb arma,1,1:offset limb arma,1,0,0,-8Confusedcale limb arma,1,150,150,60
add limb arma,2,2Confusedcale limb arma,2,12,50,7:rotate limb arma,2,90,0,0:offset limb arma,2,0,0,-10
color object arma,rgb(10,10,10)
make object box bala,1,1,20:color object bala,rgb(200,0,0):hide object bala
make object sphere 3,30
position object 3,600,20,600

do
gosub _controla_camara
gosub bala
if object collision(bala,3)=1 then position object 3,300+rnd(1000),10,300+rnd(1000)
sync
loop

_controla_camara:
`player controls (camera)
if upkey()=1 then x#=newxvalue(x#,a#,1) : z#=newzvalue(z#,a#,1)
if downkey()=1 then x#=newxvalue(x#,a#,-1) : z#=newzvalue(z#,a#,-1)
if leftkey()=1 THEN x#=NEWXVALUE(x#,a#-90,1)
if leftkey()=1 then z#=NEWZVALUE(z#,a#-90,1)
if rightkey()=1 THEN x#=NEWXVALUE(x#,a#-90,-1)
if rightkey()=1 then z#=NEWZVALUE(z#,a#-90,-1)

`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
`first person camera controls
`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yrotate camera camera angle y()+(mousemovex()/10.0)
xrotate camera camera angle x()+(mousemovey()/10.0)
a#=camera angle y()

`limitacion de la camara
if camera angle x() >60 then xrotate camera 60
if camera angle x() <-45 then xrotate camera -45
`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


`updating camera, gun and bullets positions
position camera x#,145,z#
position object arma,x#,145,z#
position object bala,x#,145,z#


set object to camera orientation arma

`moving slightly the gun to its correct position (aprox.)
move object arma,15
move object right arma,3
move object down arma,3

move object bala,15
move object right bala,3
move object down bala,3

return

bala:
set cursor 310,235:ink rgb(255,0,0),0
print " +"
`-------------------------------------------------------------
`making bullet shoot where the gun ends
if dispara=0
set object to object orientation bala,arma
endif
if mouseclick() and dispara=0
dispara=1
show object bala
endif

if dispara=1
la=la+10
run=run+1
move object bala,la
endif

if run>200
run=0
la=0
dispara=0
hide object bala
endif
return
`--------------------------------------------------------


RE: Piazzare un arma in primo piano - Jonathan Archer - 15-08-2010

Grazie Jumpone lo provo in un baleno Wink


RE: Piazzare un arma in primo piano - VisualJump3D - 15-08-2010

Provato ?


RE: Piazzare un arma in primo piano - Jonathan Archer - 15-08-2010

Funzionante grazie Wink Anche se shottare con un arma fatta di quadrati é orribile xD Avendo DBClassic Originale nel CD2 ho trovato varie armi, ho caricato una pistola e é venuto carino. Certo non é il massimo ma é già un buon risultato, grazie Jumpone ci serve gente che ne sa. Prossimamente cosruisco 1 mappa e vi metto qualche screen Smile


RE: Piazzare un arma in primo piano - VisualJump3D - 15-08-2010

Questo era un esempio per imparare !


RE: Piazzare un arma in primo piano - Jonathan Archer - 16-08-2010

Certamente Jump. Ora esporto la mappa xké su DB mi da tutto fatto con un unica texture Smile


RE: Piazzare un arma in primo piano - Jonathan Archer - 16-08-2010

EDIT1: Ecco 1 screen con un AK47
[Immagine: ak47uq.png]