Some awesome code.
Thank you so much! It worked perfectly!
Not Telling
JamEngulfer221 hasn't added any friends yet.
26 February 2012 - 05:16 PM
Some awesome code.
10 February 2012 - 05:35 PM
// Draw the sprite and the required price
{
draw_sprite(sprite_index,image_index,x,y);
if image_index = 1
{
draw_set_color(c_white);
draw_set_font(ft_hud);
draw_text(x,y,price);
}
var width, height, range, rate, damage, name;
range = 200;
rate = 3;
damage = 10;
name = 'Laser';
width = sprite_get_width(sprite_index)/2;
height = sprite_get_height(sprite_index)/2;
if mouse_x>x-width and mouse_x<x+width and
mouse_y >y-height and mouse_y<y+height
{
draw_set_font(ft_header);
draw_text(400,2,name);
draw_set_font(ft_hud);
draw_text(400,32,'Damage: '+string(damage)+' HP');
draw_text(400,48,'Range: '+string(range));
draw_text(400,64,'Fire rate: '+string(rate)+' shots/second');
draw_text(400,80,'Selling price: '+string(floor(price/2)));
}
}
05 February 2012 - 07:43 AM
with(x) //where x = id of a Tower_Laser instance { draw_text(); }
Remove the 'obj_tower_laser.' prefix in your draw_text script
04 February 2012 - 10:19 PM
You can't reference the variables of an Object - because it doesn't exist. Think of an Object like a definition/class - an abstract idea. An instance is a realization of that idea. You need to create an instance of an object in order to use it. You then access the instance's variables - not the Objects.
04 February 2012 - 09:56 PM
Your not in the CSUC game production class by chance?
Community Forum Software by IP.Board
Licensed to: YoYo Games Ltd

Find content