All of these activities are on offer at schools that have adopted a new curfew to try to stop pupils leaving the premises at lunchtime to visit burger vans and chip shops.

From the beginning of this term, about 1000 first-year pupils from eight secondaries run by Glasgow City Council have been asked to stay in school at break time and eat either a packed lunch or a school meal.

The year-long pilot – a Scottish first – is designed to encourage healthy eating habits by removing easy access to unhealthy food in nearby shops and fast-food outlets.

Pupils will also be encouraged to participate in sports and other lunchtime activities to make the experience as healthy and fun as possible.

So far, the experience at All Saints Secondary, in the north of the city, whose catchment area includes Balornock, Barmulloch and Milton, has been a positive one, with pupils enjoying both the food and the activities.

“It’s great, because you can try different healthy food every day and you don’t want to grow up eating food with too much sugar and salt and fat in,” said 12-year-old Amy McLeod.

Dan Brady, 11, added: “I would rather be in school with my friends playing football or having a go at the other activities than wandering around the streets.”

Gerry Lyon, the school’s headteacher, is also pleased with the first few weeks of the initiative, which he believes will have a number of benefits.

“We try to give the pupils as many healthy messages as possible and to have all the first years in the school at lunchtime helps that enormously,” he said.

“We also believe it is a good thing because we know where the pupils are and we know that they are safe.”

Targeting secondary pupils is crucial, as attempts to encourage them to eat more healthily have so far failed.

Scotland is currently in the grip of an obesity epidemic, with one in five boys and more than one in seven girls aged two to 15 years old classed as obese. Evidence suggests attempts to target the problem through healthier school meals is foundering.

Official statistics for secondary schools published earlier this year show the proportion who eat school meals has dropped from more than 50% in 2003 to just 39% this year – the lowest figure for a decade.

The decline is particularly worrying because it comes as a direct result of the introduction of healthier menus in schools from 2002 onwards in an attempt to tackle Scotland’s chronic obesity problems.

Both the former Labour-run Scottish Executive and the current SNP Government have backed the health drive, which has seen chips, burgers, pizzas and fizzy drinks phased out.

However, pupils have been voting with their feet and leaving school at lunchtime to buy food at nearby takeaway shops or burger vans.

Steven Purcell, leader of Glasgow City Council, believes the lunchtime curfew – a policy adopted by many private schools – could be an important step towards improving the uptake of school meals, and is considering extending the scheme if it proves a success.

“We will be evaluating what happens at these two schools and, if it is seen to be a success, and the pupils themselves tell us they like it, then we will consider extending the pilot to other schools and into other year groups,” he said.

Professor Mike Lean, chairman of human nutrition at Glasgow University, has already backed the initiative.

“The average first-year secondary pupil is not ready to make informed choices about the food they eat and what is best for them in nutritional terms,” he said earlier this year.

“Keeping them in at lunchtime in S1 will help schools educate children about food, and other councils should consider adopting this.”

However, the scheme has had its detractors, with Judith Gillespie, policy development officer for the Scottish Parent Teacher Council, saying: “As youngsters move into secondary they have to take control of their lives, and deciding what they eat is part of that process.”