Yesterday I received my first eye injection to treat the condition that has developed with the retina in my left eye. I can't say I relished the prospect of someone sticking a needle in my eye and squirting liquid into it, but then again, I was nowhere near as aghast or horrified as the people I told about it - one person said "don't tell my husband, he'll throw up on you!".
No doubt, the ghoulish reader will want me to get straight to the bit where I describe the crazed doctor, laughing maniacally, stabbing me in the eye causing me to convulse and scream in agony. Well, there you go, I've just done it. Non-ghoulish readers, read on...
In the week since I'd been diagnosed, the distortion had spread across my retina so that it now affects the centre of my vision. This perturbed me enough so that I returned to the hospital and successfully (and politely) argued with the medics to get the treatment brought forward by a week. If the damage was likely to be permanent, it was paramount to get treatment as soon as I could.
I arrived at the eye clinic at 8.45am on a Tuesday morning for my injection, but was kept waiting for an hour. It's beyond me how you can be an hour behind at the start of the day, but the lumbering, administration-heavy machine that is the NHS is like that. That said, in my experiences, and as this story will demonstrate, the care that machine facilitates, to every citizen of the UK, regardless of income or means, is very definitely not broken.
My fellow eye-patients probably had an average age of well above seventy, and these veterans of the eye clinic, and life in general, sat there looking relaxed and possibly slightly bored. I have to marvel at the stoicism of elderly Glaswegians. If these old codgers and codgerinas could stick it, so could I.
The substance to be injected into my eye is called Ranibizumab, though it is more commonly known by its brand name Lucentis. It is derived from an antibody found in mice and inhibits the growth of blood vessels which may leak fluid into the eye, causing the edema (swelling) that is distorting my retina. Apparently Lucentis costs over $1000 per dose, whereas there exist alternatives priced at $40 per dose that are claimed to be as effective. I suspect massive profiteering is going on here and plan to investigate further.
Anyway, after 45 minutes in the large, main waiting room, and 15 minutes sat in a chair in a corridor, I was called into the small room. There was a reclining, padded chair, much like one you'd find in a dentist's surgery, a table and a cabinet stuffed with packets of medical equipment. It was soon apparent who the doctor was, as he swept around the room, talking in a clear, confident voice, not a hint of doubt coming into anything he said. There was also a specialist nurse and he too seemed sure of what he was doing, but spoke less and was more garbled. And there was another nurse who, after than showing me into the room, seemed to be waiting quietly in the corner.
I lay down on the chair and it whirred and reclined me. I asked the doctor a few questions about my condition and he gave me clear, matter-of-fact answers. Apparently, some people thought eating leafy greens helped this condition and, he said, it was always good to be trying things that made you think you were helping yourself. After I said I wasn't a smoker, he spoke a bit about how bad smoking was for macular edema and health in general.
Through all of this conversation, he and the specialist nurse were buzzing about me, swabbing my eye, preparing the eye and giving me a few anesthetic drops. I think this went on for about ten minutes and the chat not only informed me but helped keep me distracted. Since I wasn't wearing my glasses I couldn't really see much, but I was thinking "is the needle coming now?" They placed something like a large plaster over my eye and peeled a layer away to reveal a transparent layer. I think this was to hold my eye in place with the eyelid clamped back, but I was already doing my level best to keep my eyes still. I suspected the moment was coming when the nurse took my hand and began to squeeze and stroke it gently. Simultaneously, the doctor who was hovering around behind me and to my left began to move something towards my eye. Being so myopic I couldn't see it, which was probably a good thing, and then there was a strange sensation - not pain, more like a dull ache. A giant floater appeared in my eye and I mentioned it. The doctor apologised, saying that a wee bit of air had got in, but it should be harmless and would sink to the top of my vision when I stood up (the image on the retina is inverted, the brain reverts for you).
So that was it. I really couldn't fault the way it was done: friendly, professional and caring. If I was a macho man, I might have rejected the nurse's hand-holding, but I'm not and it helped. She was doing more than a job, she was caring about her job and the human before her. I could easily imagine a bean-counter, administrator saying "we don't need two nurses in the Lucentis clinic", but if they did, someone with more sense prevailed.
For the rest of the day, it felt like there was something in my eye and so I was blinking a lot and it was very teary. I suspect that the "something" in my eye was a little rough spot on my eyeball where the needle went in and that was irritating my eyelid. The eye was a little red, but other than that and a slightly dull ache around my eye, I experienced no other untoward symptoms.
The distortion in my left eye has got no better or worse in the last week or so, but it is quite possible that it stabilised by itself before the injection. My brain is doing a better job at compensating: unless I consciously look for it, the distortion isn't apparent to me most of the time. My binocular vision is still a little compromised as my brain struggles to reconcile the different images coming from my left and right eyes, but I think it's improving too. I try to give it a helping hand by increasing font sizes on the computer, for which the zoom function in my web browser (firefox) comes in very handy. So far, so good.
But, I'm remarkably lucky. Does every human on Earth get such treatment? Would I have got it 100 years ago in this country, without the NHS? No. I'm very, very grateful and I hope that one day everyone can expect at least this level of heath care.
Thursday, October 4, 2012
Saturday, September 8, 2012
Real retinal resolution
Sometimes you notice a small thing that turns out to have much larger implications. So it happened last week. I noticed that the lines along the top of a spreadsheet seemed to bend, just slightly and only for a fraction of a second as I shifted my gaze - but I saw it. I thought at first it was some problem with my monitor, but when I saw it happen on another computer, I knew it was me and not the machine that was faulty.
I am very short sighted and this results in the retina being stretched and made very thin and prone to spontaneous damage. The retina is the surface at the back of your eye that has many receptors that detect light. Each receptor feeds pulses to your optic nerve that allow the brain to construct an image that you see, well, that you think you see (it's a long story). It didn't take me long to realise that the retina in my left eye was faulty and I wasted no time in making an appointment at the optician. This was Friday.
On Saturday morning I saw the optometrist and she was extremely diligent and tested my eyes and photographed my retina but could find nothing wrong. She then arranged to have a 3D scan performed to see if the damage was below the retinal surface, but that too was inconclusive. We both agreed that whatever had happened to my eye, it was not deteriorating, so she arranged an appointment at the hospital at 10am on Monday, but warned me to go to A&E if the condition changed over the weekend.
On Monday I spent the day having the same tests again and was given a thorough examination by a young doctor. She too was unable to identify the problem either by direct examination or from the results of any of the scans. She called in the consultant and he spotted a small hint on one of the scans and sent me off for a dye test. This test involves the injection of a yellow dye (fluoroscein) into the veins so that it will travel through your whole body; any disturbed or exposed blood vessels in the retina will give off a strong glow. I was warned that the dye would give me the appearance of a Homer Simpson, but it didn't give me more than a mild tan, though it did turn my urine a spectacular fluorescent yellow.
The dye-test showed the problem - I had a macular edema. The macula is the part of the eye that is most densely covered in receptors and it is what we rely on for detail in the centre of our vision. We rely on it for reading and perceiving fine detail in facial recognition. Edema means swelling - in my case a membrane at the back of my retina had ruptured causing liquid to enter an area just below the retinal surface. The consequence of this is that receptors in my eye have been re-arranged and possibly damaged.
The consultant explained all this to me and to be honest I was not at all alarmed. I already knew that my retina was damaged and, if anything, was reassured to have the details of it recognised and explained to me by an expert. I guessed that the damage was permanent but also guessed that, in time, my brain would be able to cope with this disruption, perhaps even learn the new locations of the remaining and undamaged receptors. The consultant confirmed this to me. He also assured me that there was a viable treatment that could prevent further deterioration, though this involved a series of injections into the eyeball and that the eye would need close attention for years to come.
For now, I need to live with a distortion in my left eye. In some circumstances, e.g. when outside or just looking around a room or driving, it is barely noticeable. At most I'll notice a brief kink in a window frame or a bend in a lamp post, but only fleetingly. If I use only my left (damaged) eye to read, then I can focus on a word with little distortion, but two or three words to the right do appear distorted, though legible. Using both eyes together is better, but I can feel the extra strain on my brain and eyes of having to reconcile two different images. But, in time, I'm sure my brain will rewire itself.
The distortion itself is always in the same place, a little to right and above my centre of vision. It is shaped like a flower and resembles five or so overlapping circles. Inside this shape my vision is distorted. I was pleased the other day that when I placed the Moon inside it (which was actually quite tricky) that I could still see it, although it was not round, nor could I see much in the way of features on it. The size of distortion is about half the area of my clenched fist held at arms length, so approximately 5 degrees across its longest part. If I close my eyes for a few seconds and then open them I can clearly see the outline of it, but just for a moment. If I blink rapidly I can see it as a blob, much like the blob left after you have viewed a bright object such as the Sun. Sometimes it reminds me of a poor Star Trek special effect, minus the Enterprise.
I can live with this level of distortion, but I do fear it deteriorating and spreading to cloud my entire vision in that eye. If, as is possible, a problem develops with my right eye then my visual acuity could deteriorate to the point where I can no longer read, but I won't go completely blind. Although the cause is different, the effects are not unlike the macular degeneration experienced in older people. I have to face up to the fact that significant loss of my eyesight is likely to occur as I age and that what some people face in their late seventies or eighties has started (just) before I reach 40.
This prospect is causing me some anxiety and I can feel a black cloud hovering behind me, dampening my ambitions and tempting me to retreat, dwell and introspect. To give into that leads to depression, so my aim is to reaffirm my ambitions and keep going regardless. I will take the treatment on offer, I will have faith that although my eyesight is failing, that it will do so in a stable way and that, at least for now, my brain can adapt. And, if things get so bad that brain cannot compensate then I will turn to computers and technology for help and rely more on my ears, for example by using audio books. But at the same time I must acknowledge this new limitation.
I feel fortunate that my interests are varied enough that the limitation will not dampen my enthusiasm for life. I am even more fortunate that I have a loving and supportive family around me and some very good friends. In fact, it has already occurred to me that limitation is not always a bad thing - I am prone to trying to do too much at once and so frustrate my ambitions in any one endeavour. Also, wherever I go, and wherever I look, I am now always accompanied by a colourful little amoeba-like flower when I blink, and, for reasons I don't quite understand myself, I actually feel some affection for the little thing.
I am very short sighted and this results in the retina being stretched and made very thin and prone to spontaneous damage. The retina is the surface at the back of your eye that has many receptors that detect light. Each receptor feeds pulses to your optic nerve that allow the brain to construct an image that you see, well, that you think you see (it's a long story). It didn't take me long to realise that the retina in my left eye was faulty and I wasted no time in making an appointment at the optician. This was Friday.
On Saturday morning I saw the optometrist and she was extremely diligent and tested my eyes and photographed my retina but could find nothing wrong. She then arranged to have a 3D scan performed to see if the damage was below the retinal surface, but that too was inconclusive. We both agreed that whatever had happened to my eye, it was not deteriorating, so she arranged an appointment at the hospital at 10am on Monday, but warned me to go to A&E if the condition changed over the weekend.
On Monday I spent the day having the same tests again and was given a thorough examination by a young doctor. She too was unable to identify the problem either by direct examination or from the results of any of the scans. She called in the consultant and he spotted a small hint on one of the scans and sent me off for a dye test. This test involves the injection of a yellow dye (fluoroscein) into the veins so that it will travel through your whole body; any disturbed or exposed blood vessels in the retina will give off a strong glow. I was warned that the dye would give me the appearance of a Homer Simpson, but it didn't give me more than a mild tan, though it did turn my urine a spectacular fluorescent yellow.
The dye-test showed the problem - I had a macular edema. The macula is the part of the eye that is most densely covered in receptors and it is what we rely on for detail in the centre of our vision. We rely on it for reading and perceiving fine detail in facial recognition. Edema means swelling - in my case a membrane at the back of my retina had ruptured causing liquid to enter an area just below the retinal surface. The consequence of this is that receptors in my eye have been re-arranged and possibly damaged.
The consultant explained all this to me and to be honest I was not at all alarmed. I already knew that my retina was damaged and, if anything, was reassured to have the details of it recognised and explained to me by an expert. I guessed that the damage was permanent but also guessed that, in time, my brain would be able to cope with this disruption, perhaps even learn the new locations of the remaining and undamaged receptors. The consultant confirmed this to me. He also assured me that there was a viable treatment that could prevent further deterioration, though this involved a series of injections into the eyeball and that the eye would need close attention for years to come.
![]() |
| An idea of the view through my left eye if I'm looking at the word "just". |
![]() | |
| What I see when I blink, with added starship. |
I can live with this level of distortion, but I do fear it deteriorating and spreading to cloud my entire vision in that eye. If, as is possible, a problem develops with my right eye then my visual acuity could deteriorate to the point where I can no longer read, but I won't go completely blind. Although the cause is different, the effects are not unlike the macular degeneration experienced in older people. I have to face up to the fact that significant loss of my eyesight is likely to occur as I age and that what some people face in their late seventies or eighties has started (just) before I reach 40.
This prospect is causing me some anxiety and I can feel a black cloud hovering behind me, dampening my ambitions and tempting me to retreat, dwell and introspect. To give into that leads to depression, so my aim is to reaffirm my ambitions and keep going regardless. I will take the treatment on offer, I will have faith that although my eyesight is failing, that it will do so in a stable way and that, at least for now, my brain can adapt. And, if things get so bad that brain cannot compensate then I will turn to computers and technology for help and rely more on my ears, for example by using audio books. But at the same time I must acknowledge this new limitation.
I feel fortunate that my interests are varied enough that the limitation will not dampen my enthusiasm for life. I am even more fortunate that I have a loving and supportive family around me and some very good friends. In fact, it has already occurred to me that limitation is not always a bad thing - I am prone to trying to do too much at once and so frustrate my ambitions in any one endeavour. Also, wherever I go, and wherever I look, I am now always accompanied by a colourful little amoeba-like flower when I blink, and, for reasons I don't quite understand myself, I actually feel some affection for the little thing.
Monday, August 6, 2012
Owncloud
Go into the "cloud", use the "cloud", harness the power of the "cloud", "cloud" computing, "cloud" this, "cloud" that... blah blah blah. Of course, the word has some meaning, but it has been so abused, misused and used to confuse that I now find it irksome. But there are more tangible problems with the ideas behind it. (I'll stop using "scare" quotes now.)
The obvious problem with storing your data in the cloud is that you don't know where it is or who can see it. Another problem is that if you use software that is in the cloud, for example gmail, then you have zero control over changes to that software. If google decides to update gmail, you will be forced to switch to the new version at some point whether you want to or not.
I could live - and do live - with these and other drawbacks of the cloud, but there is one other problem that troubles me more. I rely on google for mail, contacts, calendar, documents, web sites, my phone, this blog... Although I have no particular problem with Google at the moment, it does not sit well with me to have so many eggs in one monopolist's basket.
So when I first came across ownCloud, I was immediately attracted to the idea. ownCloud is software you can install on your own webserver and you can control how your data is stored and accessed and since the software is Free and Open Source (under the AGPL license), you have as much control over it as you could wish for.
Of course, not everyone has the time, inclination, knowledge or money to run their own web server, but then perhaps there is a web-skilled friend you might trust, or you could choose to use a commercial provider who is offering a pre-installed set up for you. The project has a company (owncloud.com) that lives in symbiosis with the open source community (owncloud.org).
So far I've tried out the file sharing, music, calendar, contacts and gallery aspects of owncloud and experimented accessing it from my android phone. My server is in my house running on a low-power linutop 2. It's not fast, but fast enough for my purposes just now. I will write another post with more technical aspects.
Once I've finished a bit more fettling, perhaps I will invite some friends into my ownCloud, but will they trust me with their precious data?
The obvious problem with storing your data in the cloud is that you don't know where it is or who can see it. Another problem is that if you use software that is in the cloud, for example gmail, then you have zero control over changes to that software. If google decides to update gmail, you will be forced to switch to the new version at some point whether you want to or not.
I could live - and do live - with these and other drawbacks of the cloud, but there is one other problem that troubles me more. I rely on google for mail, contacts, calendar, documents, web sites, my phone, this blog... Although I have no particular problem with Google at the moment, it does not sit well with me to have so many eggs in one monopolist's basket.
So when I first came across ownCloud, I was immediately attracted to the idea. ownCloud is software you can install on your own webserver and you can control how your data is stored and accessed and since the software is Free and Open Source (under the AGPL license), you have as much control over it as you could wish for.
Of course, not everyone has the time, inclination, knowledge or money to run their own web server, but then perhaps there is a web-skilled friend you might trust, or you could choose to use a commercial provider who is offering a pre-installed set up for you. The project has a company (owncloud.com) that lives in symbiosis with the open source community (owncloud.org).
So far I've tried out the file sharing, music, calendar, contacts and gallery aspects of owncloud and experimented accessing it from my android phone. My server is in my house running on a low-power linutop 2. It's not fast, but fast enough for my purposes just now. I will write another post with more technical aspects.
Once I've finished a bit more fettling, perhaps I will invite some friends into my ownCloud, but will they trust me with their precious data?
Sunday, July 1, 2012
Raspberry pi - beta lego
My RPi now has a new home - a lego case. I tried to convince my 7 year old son to build it, but he felt playing minecraft and ace of spaces on the computer was more important, so I rummaged through his lego collection and constructed what you see below.
OK, so it's not going to win any prizes, but it does have windows. No, not microsoft windows, but windows through which you can see its LEDs. Just look at the cosy glow from its rear window. (I've decided that the ethernet cable gets plugged up its arse and its power goes in its mouth.)
I've also installed a new operating system, the beta of Debian wheezy for the RPi, and it seems to work just fine. I've fed back one minor problem I had (to do with he config tool) to the developer via github and I hope to contribute a bit more in the future.
My next task was to set up ssh access, which was easily done with this command:
and to make sure this happens after every boot, I issued this command:
Of course, this isn't much use if you don't know the IP number, so to set a static IP I just had to edit /etc/network.interfaces to read:
gateway 192.168.1.1
When I'm ssh'ing into it, I don't type in 192.168.1.23 every time, instead I gave this IP the identity of "summerston" on my other computers (editing /etc/hosts on linux) in keeping with my policy of naming my computers after defunct Glasgow train stations (Summerston train station is actually open, but the original station from which it gets its name, but which was several miles away, has been closed for about forty years).
The last thing I set up was a VNC server so I could access the GUI desktop from my laptop, this was just two commands. The first installed the necessary software:
and the second started the server:
I was then able to access the desktop from my laptop using KDE's VNC client called KRDC and also my phone using a VNC app. It looked just like this:
I've also installed a new operating system, the beta of Debian wheezy for the RPi, and it seems to work just fine. I've fed back one minor problem I had (to do with he config tool) to the developer via github and I hope to contribute a bit more in the future.
My next task was to set up ssh access, which was easily done with this command:
sudo service ssh start
and to make sure this happens after every boot, I issued this command:
sudo insserv ssh
Of course, this isn't much use if you don't know the IP number, so to set a static IP I just had to edit /etc/network.interfaces to read:
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.23
netmask 255.255.255.0iface lo inet loopback
iface eth0 inet static
address 192.168.1.23
gateway 192.168.1.1
When I'm ssh'ing into it, I don't type in 192.168.1.23 every time, instead I gave this IP the identity of "summerston" on my other computers (editing /etc/hosts on linux) in keeping with my policy of naming my computers after defunct Glasgow train stations (Summerston train station is actually open, but the original station from which it gets its name, but which was several miles away, has been closed for about forty years).
The last thing I set up was a VNC server so I could access the GUI desktop from my laptop, this was just two commands. The first installed the necessary software:
sudo apt-get install tightvncserver
and the second started the server:
vncserver :1
I was then able to access the desktop from my laptop using KDE's VNC client called KRDC and also my phone using a VNC app. It looked just like this:
Wednesday, June 27, 2012
Raspberry pi - first steps
After waiting a couple of months, my raspberry pi finally arrived the other day. For those of you that don't know, it is a ludicrously cheap ($35 or £25) computer that is sold as a bare board with a few connectors on it. In contrast to the out-of-the-box shininess that is now the raging fashion, this wee beastie is minimal and challenges you to learn something about it, and about computers in general. In fact, that's exactly why the raspberry pi came into being.
The tiny thing on top of the standard PC case in this photo is my raspberry pi. There are only two cables plugged in here: the ethernet cable at the back and the power cable (standard USB phone charging cable) at the front. You can also just make out the SD card which is slotted in the same side as the power cable. This serves as its disk drive.
My first task after unboxing my new, little friend was to write the operating system to the SD card. This was simple enough, I downloaded the Debian linux image from the raspberry pi website, verified the file's integrity by its sha1 sum using this command
stuck the SD in my laptop (running slackware linux 13.37) and ran
(first checking that the SD card was /dev/sdb - much badness can occur if you get that wrong!). I then put the card in raspberry pi, plugged it into my TV using the HDMI cable, plugged in a USB wireless keyboard and mouse and then... drum roll... plugged it into the power and... more drum roll... some LEDs flashed but nothing appeared on the TV. It turned out that the TV had to be on and set to HDMI before I turned on the pi and once I did that... yet another drum roll... it worked! Text scrolled by and the little raspberry pi logo sat at the top left of the screen, looking cute and somehow content.
I was then able to start X windows with the LXDE desktop by issuing the command 'startx' and soon I had a giant logo emblazoned on my 32" TV. After some fiddling around loading the sound module I got the sound working and was able to listen to the short demo piece of music that comes with the music player. The software to get the pi's hardware doing its stuff is still in development and the sound is apparently quite buggy at present. My next task will probably be to get beta testing the next version of the Debian OS for the pi.
So, what am I going to do with it? I don't yet know exactly what I'll do with it, except probably what any child would do with a new toy: play with it.
The tiny thing on top of the standard PC case in this photo is my raspberry pi. There are only two cables plugged in here: the ethernet cable at the back and the power cable (standard USB phone charging cable) at the front. You can also just make out the SD card which is slotted in the same side as the power cable. This serves as its disk drive.
sha1sum debian6-19-04-2012.img
stuck the SD in my laptop (running slackware linux 13.37) and ran
dd bs=1M if=debian6-19-04-2012.img of=/dev/sdb
(first checking that the SD card was /dev/sdb - much badness can occur if you get that wrong!). I then put the card in raspberry pi, plugged it into my TV using the HDMI cable, plugged in a USB wireless keyboard and mouse and then... drum roll... plugged it into the power and... more drum roll... some LEDs flashed but nothing appeared on the TV. It turned out that the TV had to be on and set to HDMI before I turned on the pi and once I did that... yet another drum roll... it worked! Text scrolled by and the little raspberry pi logo sat at the top left of the screen, looking cute and somehow content.
I was then able to start X windows with the LXDE desktop by issuing the command 'startx' and soon I had a giant logo emblazoned on my 32" TV. After some fiddling around loading the sound module I got the sound working and was able to listen to the short demo piece of music that comes with the music player. The software to get the pi's hardware doing its stuff is still in development and the sound is apparently quite buggy at present. My next task will probably be to get beta testing the next version of the Debian OS for the pi.
So, what am I going to do with it? I don't yet know exactly what I'll do with it, except probably what any child would do with a new toy: play with it.
Saturday, April 28, 2012
Science and family
I had the pleasure of giving planetarium shows using Glasgow University's inflatable Starlab planetarium. I was ably assisted by son who operated its controls - no mean feat for a 7 year old surrounded by people, lots of noise and in the dark.
I'd like to share something with you which has been bouncing around in my mind this last week. Almost 50 years ago, a young woman came over from Iran. She spoke very little English but was determined to spend a few years in the UK to further her career in nuclear physics. She not only ended up with a PhD, but also found a husband, settled in Bearsden, Glasgow and secured a research job working on Glasgow University's linear accelerator. When she became pregnant she was forced to stop working around radiation and went on early maternity leave to have her baby. That baby was me. (Yes, the radiation exposure probably does answer a lot of your questions about me.)
Unfortunately, the concept of maternity leave was not well established back then, especially in the very male-dominated profession of academic science and so my mother was not able to resume her scientific career, but she did, after much perseverance, manage to return to work at Glasgow University in computing. Although disappointed in this, she was a fantastic and devoted mother and gave my sister and I the best start in life one could wish for. I know she was pleased that my sister and I went on to have careers in science and engineering and particularly that my sister was able to have two children without much detriment to her career.
My mother died a year and a day before the science fair, and that has been on my mind quite a bit this week. But I'm absolutely sure she would've loved it and been delighted to see such a great science fair being run by a group of mothers, with a little help from a few dads.
Friday, December 30, 2011
C++, SDL and oPong
During the peaceful days between Christmas and New Year, I set myself the task of learning how to use the low-level graphics library SDL. My interest was piqued by playing a few games that have used SDL to good effect to cross platforms, especially to work smoothly on linux distributions.
SDL is written in C, which I know fairly well, but because most games and so online tutorials are now in C++ I decided to use that, even though I'm less familiar with it. Since I'm using a full install of Slackware Linux 13.1 (which is fairly old now, but works fine) on my fast desktop machine, I was pleased to find that GNU compiler g++ was already installed, along with SDL and all the other tools such as make and text and graphic editors that I needed to get started.
After a bit of surfing I found myself following this excellent set of tutorials from Lazy Foo - and did them dutifully - I read each one, downloaded the source code, compiled it and ran it and sometimes tweaked it to try out other ideas. I found them easy to read and the code compiled and worked flawlessly each time. Much kudos to Lazy Foo for the effort s/he put in there (despite claiming to be lazy). I also gained a good boost from this tutorial for C++ for C programmers.
So, what is oPong? Well, I decided that after reaching Lazy Foo's lesson 18 that I could try out creating an old game - pong - but with a new twist. In my version, there would be only one bat and it would move around a circle. Also, every time you hit the ball you get a point, but the bat also gets shorter, making the game increasingly more difficult as you progress. I spent almost zero time on how it looks, as you can see by this screenshot:
I found the process of writing it quite straightforward, with two stumbles along the way. I was surprised at just how low-level SDL was - it didn't have any functions for drawing circles or lines. All SDL can do is fill rectangles and draw sprites (i.e. graphics loaded from image files ). The upside is that SDL is fast and gives you fine control over the graphics.
The second problem I encountered was with handling the angles, which caused a hard to diagnose bug where the collision routine failed and allowed the ball to pass through the bat at its left most position. This was caused by the fact that the angles flipped from -PI to PI at this position. I remedied the problem with some extra code that carefully handled the difference in angles.
I'm not sure what, if anything, I may do next with SDL, but I enjoyed getting to grips with it and C++. Also, I am pleased that fairly low-level graphics access is still readily available on our increasingly complex computer systems. Clearly, I draw pleasure from some odd things.
You can download the source code for oPong from here.
SDL is written in C, which I know fairly well, but because most games and so online tutorials are now in C++ I decided to use that, even though I'm less familiar with it. Since I'm using a full install of Slackware Linux 13.1 (which is fairly old now, but works fine) on my fast desktop machine, I was pleased to find that GNU compiler g++ was already installed, along with SDL and all the other tools such as make and text and graphic editors that I needed to get started.
After a bit of surfing I found myself following this excellent set of tutorials from Lazy Foo - and did them dutifully - I read each one, downloaded the source code, compiled it and ran it and sometimes tweaked it to try out other ideas. I found them easy to read and the code compiled and worked flawlessly each time. Much kudos to Lazy Foo for the effort s/he put in there (despite claiming to be lazy). I also gained a good boost from this tutorial for C++ for C programmers.
So, what is oPong? Well, I decided that after reaching Lazy Foo's lesson 18 that I could try out creating an old game - pong - but with a new twist. In my version, there would be only one bat and it would move around a circle. Also, every time you hit the ball you get a point, but the bat also gets shorter, making the game increasingly more difficult as you progress. I spent almost zero time on how it looks, as you can see by this screenshot:
I found the process of writing it quite straightforward, with two stumbles along the way. I was surprised at just how low-level SDL was - it didn't have any functions for drawing circles or lines. All SDL can do is fill rectangles and draw sprites (i.e. graphics loaded from image files ). The upside is that SDL is fast and gives you fine control over the graphics.
The second problem I encountered was with handling the angles, which caused a hard to diagnose bug where the collision routine failed and allowed the ball to pass through the bat at its left most position. This was caused by the fact that the angles flipped from -PI to PI at this position. I remedied the problem with some extra code that carefully handled the difference in angles.
I'm not sure what, if anything, I may do next with SDL, but I enjoyed getting to grips with it and C++. Also, I am pleased that fairly low-level graphics access is still readily available on our increasingly complex computer systems. Clearly, I draw pleasure from some odd things.
You can download the source code for oPong from here.
Subscribe to:
Posts (Atom)






