Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Blood Splatter =P
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Flikerator




PostPosted: Sun Dec 25, 2005 12:43 am   Post subject: Blood Splatter =P

Yarr im working on blood splatter. Heres what I like and what I dont like about my current blood splatter I have; http://www.deviantart.com/view/26820432/

This is the code I have for it. This is just my test program I use to figure things out, before I add it into the main prog. I could easily make this program work correctly with a few if statements, but I would prefer to just have a working formula ^_^

code:

View.Set ("offscreenonly")

var x1, x : real := Rand.Int (45, maxx - 45)
var x2 : real := Rand.Int (45, maxx - 45)
var y1, y : real := Rand.Int (45, maxy - 45)
var y2 : real := Rand.Int (45, maxy - 45)

var xslope : real := (x2 - x1) / Math.Distance (x, y, x2, y2) * 2
var yslope : real := (y2 - y1) / Math.Distance (x, y, x2, y2) * 2

for i : 1 .. 15
    for j : -6 .. 6 by 6
        Draw.Line (round (x2), round (y2), round (x2 + (i * xslope) + j * xslope), round (y2 + (i * yslope) - j * yslope), brightred)
    end for
end for
Draw.FillOval (round (x1), round (y1), 10, 10, red)
Draw.FillOval (round (x2), round (y2), 10, 10, red)

I cut a lot out, and its basically all you need. In the prog im using it shows the bullet and knocks the unit back and all that good stuff! Here though is just the stuff that lets you help me! Wink

40 Bits to whoever can fix it to look normal! XD
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Sun Dec 25, 2005 2:24 am   Post subject: (No subject)

Looks cool. What it looks like you want though is to just draw them from the centre of what you hit.

So use angles. Figure out the angle of the bullet, and then just draw n lines coming out of the centre of the zombie with deviation of about 5 - 10 degrees
Flikerator




PostPosted: Tue Dec 27, 2005 11:02 pm   Post subject: (No subject)

I decided instead, to draw the blood from where the unit got hit. I could do it out the back, but the end result looks a tad better from the hit location. Anyways here's the end result. Im working on a way to keep the blood permenantly on the map WITHOUT redrawing it each time. Wont be too hard. Anyways, heres the end result;


Blood Prog.zip
 Description:

Download
 Filename:  Blood Prog.zip
 Filesize:  273.88 KB
 Downloaded:  140 Time(s)

Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: