Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Sprites??? [Re: Yarwin] #223238
08/22/08 20:16
08/22/08 20:16
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Yeh they are all in the manual...

PANEL* panDisplay =
{
digits(35, 10, "a = %0.f", *, 1, a);
flags = VISIBLE;
}

the first line is creating a digits element. This allows you to show numbers on a panel. flags are just a set of switched that change the way the panel works, so VISIBLE lets the user see it.

A while loop allows a piece of code to run again and again until something is true. While(1) means run forever as 1 is the integer value for the boolean true.

wait(1) allows other functions and objects to get attention. If there was no wait() then the function would use up most resources and the program would crash.

All this is very basic programming, and can definetely be found in the lite-c workshops. Are you reading the .chm files or just looking at the codes. You have to read the helpfile.

Re: Sprites??? [Re: Omicron_NEGA] #223321
08/23/08 13:35
08/23/08 13:35
Joined: May 2008
Posts: 42
Personal
Yarwin Offline OP
Newbie
Yarwin  Offline OP
Newbie

Joined: May 2008
Posts: 42
Personal
Ignore this one please :p

Last edited by Yarwin; 08/23/08 13:42.

Team with Phix1
www.LegendWorlds.com, coming game...
Re: Sprites??? [Re: Yarwin] #223323
08/23/08 13:42
08/23/08 13:42
Joined: May 2008
Posts: 42
Personal
Yarwin Offline OP
Newbie
Yarwin  Offline OP
Newbie

Joined: May 2008
Posts: 42
Personal
The only i got from the workshop are the scripts and the files that are used into scripts like a template or something.


Team with Phix1
www.LegendWorlds.com, coming game...
Re: Sprites??? [Re: Yarwin] #223466
08/24/08 13:47
08/24/08 13:47
Joined: May 2008
Posts: 42
Personal
Yarwin Offline OP
Newbie
Yarwin  Offline OP
Newbie

Joined: May 2008
Posts: 42
Personal
So when the loop is true it means that like your HP is to 0?


Team with Phix1
www.LegendWorlds.com, coming game...
Re: Sprites??? [Re: Yarwin] #223471
08/24/08 14:04
08/24/08 14:04
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Originally Posted By: Yarwin
The only i got from the workshop are the scripts and the files that are used into scripts like a template or something.


But did you get the lite-c.chm help file? That's what you need to read or else you wont understand the scripts.

A while loop runs a code block once every frame until a certain condition is false... Here's an example.

Say i have a health pack object, and when the player touches it his/her health is increased.

var player_health = 50; > this is a variable to hold the player's health

while(player is touching health pack) // check if player is touching health pack
{
player_health +=1; > add 1 to the players health
wait(1); > resume other functions
}


now this while loop checks if the player is touching the health pack and if so, runs whatever is inside the {}. If the player isn't touching the health pack, then it returns false and the code is not run, the health is not increased.

Loops are fundamentals in programming. They are the easiest way to repeat code sections again and again, without having to re-write each line.

Last edited by DJBMASTER; 08/24/08 14:05.
Re: Sprites??? [Re: DJBMASTER] #224452
08/30/08 10:21
08/30/08 10:21
Joined: May 2008
Posts: 42
Personal
Yarwin Offline OP
Newbie
Yarwin  Offline OP
Newbie

Joined: May 2008
Posts: 42
Personal
Thank you very much! But how do i change this code so the loop will turn true when you touch the health pack object? Because, when i put this script in my game, it means that whenever or wherever i walk, i will increase my health? How can i 'link' this script to the health pack object?


Team with Phix1
www.LegendWorlds.com, coming game...
Re: Sprites??? [Re: Yarwin] #224462
08/30/08 11:55
08/30/08 11:55
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
well i wouldn't do it with a while loop, that was just to illustrate the basics of a while loop.

I would use an event...

Code:
function health_touched()
{
  if (event_type == EVENT_IMPACT)
  {
    var_health + =5;
    return;
  }
}

action add_this_to_player() 
{
  my.emask |= ENABLE_IMPACT;
  my.event = health_touched;
}


Last edited by DJBMASTER; 08/30/08 11:55.
Page 2 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1