I will and having a new impro from an example:
Okei I hope nobody gets angry if I put new question in here instead making a new short topic
The basic idea is that I want to make a healtbar that is cut shorter when health decreases. Leaving the background transparent. Achieving it in a way that I shorten the window width. (Possible method?)
I got so far with my tutorials that I covered "panels".
So here is my code which ofcourse doesn't work:
////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////////////////////////////////////////
var health = 100;
var win_width = (85*health)/100; //Calculate the number of pixels which corresponds to health filling
var win_height = 15;
//The whole panel
PANEL* lives_pnl =
{
bmap = "panel.png"; //background for bars
pos_x = 2;
pos_y = 2;
//Trying to draw healthbar with corresponding values I set earlier
window(22,4,win_width,win_height,"health.png",0,0);
flags = VISIBLE;
}
function main()
{
video_mode = 6;
//win_width = (85*health)/100;
}
Error:
< window(22,4^win_width,win_height,"health.png",0,0);>
LIFEBAR_TEST.C 5:6 (): Number syntax win_width
There seems to be some syntax thing in variable which I declared so here's the question: I can't use variables in those definitions then ?? I think right now, maybe(well actually for sure) it creates a demical number which I don't know how to define yet?