; Here it is, pardon, my lack of comments as I did this
; work between calls...
function setupfruit%()
local count%=1
local meshx#, meshy#, meshz#
local sizex#, sizey#, sizez#
for count% = 1 to 7
if count% = 1 then
fruitarray(count%)\fmodel% = loadmesh("../media/cherry.b3d")
meshx# = entityx(fruitarray(count%)\fmodel%,true)
meshy# = entityy(fruitarray(count%)\fmodel%,true)
meshz# = entityz(fruitarray(count%)\fmodel%,true)
rotatemesh(fruitarray(count%)\fmodel%,60,30,0) ; Rotate the mesh after loading it.
fitmesh(fruitarray(count%)\fmodel%, meshx#, meshy#, meshz#, 15.0, 15.0, 15.0, true)
fruitarray(count%)\number% = count%
fruitarray(count%)\name$ = "cherry"
NameEntity fruitarray(count%)\fmodel%, "cherry"
endif
;fill in like above for other fruit... Next remove all scaling and rotation code from
;level setup functions and dropitems!
next
end function
; IDEAS
;Remember to use the entityname now to test for collisions
;between items.
;Also, remember to set a name for Level and Player also,
;to make it easy to check for collisions,
;and remember to setup the collision boxes for level and
;player as well, also generally clean up code
;and update the comments to match the current code base
;state.
; Next: Work on mouse code once all other fruit
; problems /
; glitches are repaired and perfectly displayed.
PS thanks for all your help!
; work between calls...
function setupfruit%()
local count%=1
local meshx#, meshy#, meshz#
local sizex#, sizey#, sizez#
for count% = 1 to 7
if count% = 1 then
fruitarray(count%)\fmodel% = loadmesh("../media/cherry.b3d")
meshx# = entityx(fruitarray(count%)\fmodel%,true)
meshy# = entityy(fruitarray(count%)\fmodel%,true)
meshz# = entityz(fruitarray(count%)\fmodel%,true)
rotatemesh(fruitarray(count%)\fmodel%,60,30,0) ; Rotate the mesh after loading it.
fitmesh(fruitarray(count%)\fmodel%, meshx#, meshy#, meshz#, 15.0, 15.0, 15.0, true)
fruitarray(count%)\number% = count%
fruitarray(count%)\name$ = "cherry"
NameEntity fruitarray(count%)\fmodel%, "cherry"
endif
;fill in like above for other fruit... Next remove all scaling and rotation code from
;level setup functions and dropitems!
next
end function
; IDEAS
;Remember to use the entityname now to test for collisions
;between items.
;Also, remember to set a name for Level and Player also,
;to make it easy to check for collisions,
;and remember to setup the collision boxes for level and
;player as well, also generally clean up code
;and update the comments to match the current code base
;state.
; Next: Work on mouse code once all other fruit
; problems /
; glitches are repaired and perfectly displayed.
PS thanks for all your help!