 |
| Author |
Message |
chafari
User
Joined: Tue May 2nd 2006
Location: canary islands
|
|
Posted: 24th Dec 2009 07:16 Edited: 25th Dec 2009 16:07 |
| link | toggle |
Long time this thread has been sleeping.I made a poor tank with no media long time ago...now it has no textures and no firing to fit in 20 lines code.
I hope you like it
Merry Christams you all !!
sorry....the code is in post down below
learning every day
|
Back to top
 |
|
chafari
User
Joined: Tue May 2nd 2006
Location: canary islands
|
Sorry...I donīt know how to edit.
+ Code Snippetautocam off:sync on:ink rgb(0,0,0),1:box 0,0,122,80:for i= 1 to 10:ink rgb(70,60,60),1:box -10+i*12,30,i*12,50:next i
get image 1,2,0,122,80:get image 2,2,20,122,60:make object cylinder 1,50:scale object 1,70,50,20:xrotate object 1,90:fix object pivot 1
texture object 1,1:scale object texture 1,5,1:set object 1,1,1,1,0:set object cull 1,0:offset limb 1,0,0,18,0
clone object 3,1:offset limb 3,0,0,-18,0:make object box 2,30,3,21:make object box 5,30,2,2:make mesh from object 1,5
add limb 2,1,1:offset limb 2,1,10,5,0:delete mesh 1:delete object 5:color object 2,rgb(20,20,10):make object box 5000,800,0,800
position object 5000,0,-10,0:color object 5000,rgb(80,60,0):position camera -40,40,-40:point camera 0,0,0:do:s#=0.004
if upkey():scroll object texture 1,-s#,0:scroll object texture 3,-s#,0:move object right 1,0.1:move object right 2,0.1
move object right 3,0.1:endif:if downkey():scroll object texture 1,s#,0:scroll object texture 3,s#,0:move object left 1,0.1
move object left 2,0.1:move object left 3,0.1:endif:if leftkey():g#=g#+0.2:scroll object texture 1,s#,0:scroll object texture 3,-s#,0
yrotate object 1,-g#:yrotate object 2,-g#:yrotate object 3,-g#:endif:if rightkey():g#=g#-0.2:scroll object texture 1,-s#,0
scroll object texture 3,s#,0:yrotate object 1,-g#:yrotate object 2,-g#:yrotate object 3,-g#:endif:if upkey() or downkey() or leftkey() or rightkey():si=si+1
if si>80 then si=1
if si=2:p=p+1:trail=100
make object box 1000+p,10,0,30:texture object 1000+p,2:scale object texture 1000+p,0.5,2:set alpha mapping on 1000+p,50
position object 1000+p,object position x(2),object position y(2)-5,object position z(2)
yrotate object 1000+p,object angle y(2):set object 1000+p,1,1,1,1,0
if p>trail then delete object 1000+p-trail
endif:endif:sync:loop
learning every day
|
Back to top
 |
|
Veron
User
Joined: Wed Nov 22nd 2006
Location: NSW, Australia
|
You don't know how to edit but you edited the post above? This made my day.
|
Back to top
 |
|
Mew151
User
Joined: Sun Jun 1st 2008
Location: Glitch city
|
that looks pretty cool.
[href=http://pikasite.mew151.net/]http://www.mew151.net/pikasite/The%20Subject%20logo.png[/href
|
Back to top
 |
|
|
Google Ad
AdBot
Joined: Aug 26th 2002
Location: Everywhere
|
|
Back to top
 |
|
chafari
User
Joined: Tue May 2nd 2006
Location: canary islands
|
Hallo friends... I,m glad you like this litle code.
@Veron. Ha ha...I felt myself stupid... I couldnīt find the way to re-edit my post in order to mend the mess I did trying to send an image and the code...finally I found this "Edit post".
Here we have the an-compressed code with some english coments to help somehow other friends.
+ Code Snippetautocam off
sync on
hide mouse
//creatin tracks texture
ink rgb(0,0,0),1:box 0,0,122,80
for i= 1 to 10
ink rgb(70,60,60),1
box -10+i*12,30,i*12,50
next i
get image 1,2,0,122,80
get image 2,2,20,122,60
ink rgb(150,100,100),1
box 0,0,100,50
ink rgb(255,255,0),1
//traks body
make object cylinder 1,50
scale object 1,70,50,20
xrotate object 1,90:fix object pivot 1
texture object 1,1
scale object texture 1,5,1
set object 1,1,1,1,0
set object cull 1,0
offset limb 1,0,0,18,0
//making second track (copy of the first one)
clone object 3,1
offset limb 3,0,0,-18,0
//Tank body
make object box 2,30,3,21
make object box 5,30,2,2
make mesh from object 1,5
add limb 2,1,1
offset limb 2,1,10,5,0
delete mesh 1
delete object 5
color object 2,rgb(20,20,10)
//Floor
make object box 5000,800,0,800
position object 5000,0,-10,0
color object 5000,rgb(100,80,0)
position camera -70,70,-70
point camera 0,0,0
do
//positioning traks close to the body tank
s#=0.004
if upkey()
scroll object texture 1,-s#,0
scroll object texture 3,-s#,0
move object right 1,0.1
move object right 2,0.1
move object right 3,0.1
endif
if downkey()
scroll object texture 1,s#,0
scroll object texture 3,s#,0
move object left 1,0.1
move object left 2,0.1
move object left 3,0.1
endif
if leftkey()
g#=g#+0.2
scroll object texture 1,s#,0
scroll object texture 3,-s#,0
yrotate object 1,-g#
yrotate object 2,-g#
yrotate object 3,-g#
endif
if rightkey()
g#=g#-0.2
scroll object texture 1,-s#,0
scroll object texture 3,s#,0
yrotate object 1,-g#
yrotate object 2,-g#
yrotate object 3,-g#
endif
//trail headache
if upkey() or downkey() or leftkey() or rightkey()
si=si+1
if si>80 then si=1
if si=2
p=p+1
trail=100
make object box 1000+p,10,0,30:texture object 1000+p,2:scale object texture 1000+p,0.5,2:set alpha mapping on 1000+p,50
position object 1000+p,object position x(2),object position y(2)-5,object position z(2)
yrotate object 1000+p,object angle y(2):set object 1000+p,1,1,1,1,0
if p>trail then delete object 1000+p-trail
endif
endif
fps$="Fps: "+str$(screen fps())
set cursor 5,400:print fps$
sync
loop
cheers.
learning every day
|
Back to top
 |
|
jeffhuys
User
Joined: Wed May 24th 2006
Location: No cheesy line here.
|
|
Posted: 2nd Jan 2010 17:52 Edited: 2nd Jan 2010 17:59 |
| link | toggle |
Very cool!
You're the  'th to view this signature!
|
Back to top
 |
|
chafari
User
Joined: Tue May 2nd 2006
Location: canary islands
|
Ha ha..   ...It looks great !!... I suppose you have been flying with the whole tank
cheers
learning every day
|
Back to top
 |
|
Phaelax
User
Joined: Wed Apr 16th 2003
Location: Ohio
|
Quote: "ou don't know how to edit but you edited the post above? This made my day"
But look at the time stamps, the edit came way after his second post.
You should increase the transparency a little more I think on the trails. And the trails should fade out after so long, otherwise the system would bog down pretty quickly with so many objects.

> SELECT * FROM users WHERE clue > 0
> 0 rows returned
|
Back to top
 |
|
chafari
User
Joined: Tue May 2nd 2006
Location: canary islands
|
|
Posted: 5th Jan 2010 04:54 Edited: 5th Jan 2010 16:08 |
| link | toggle |
@Phaelax.
Yeahhh, you are right !! about transparency and fading trails, but it needs more code with the command " IF ", and if you put several "IF " in the same line, some commands stop working correctly, so there wasnīt room for much more code.
If it where a 50 lines challenge, I shouldnīt get rid of firing, and the tank model should be nicer as well.
+ Code Snippettrail=100
The trail is created with one by one piece of trail, and when it is biger than 100, the first piece of trail is deleted, so there are not ever 101 pieces of trail on the ground.Even if we fade some of them and finally delete this trails, the engine of dark basic is working even more than if we delete them.
We could reduce the quantity of pieces that a going to form the trail in order not to slow down the system.
learning every day
|
Back to top
 |
|
Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.
Enter a word or phrase to search our Forum for:
|
|
 |