Here’s my first, simple game using the Tyrian sprites(and of course a bit of Bortels font code). Just dodge the asteroids and pick up gems.
Copy-paste-friendly, one-giant-page version here:
It still needs a lot of polish, but I’ve got a few questions and I could always use some feedback on the code. So, on to the most pressing question:
When I play sounds I seem to get som lag/frame-skipping. Is it fixable?
Wow @Drablos, that’s a great looking project.
I believe the sound lag issue is fixed in 1.3 (as long as you use a fixed random seed for your sounds). At the moment Codea generates the sound effect each time, in 1.3 it uses a cache for sounds that have been generated in the past.
Thanks! Now that is exciting news. Then perhaps I’ll be able to add the titular “swoosh” when passing close by asteroids as initially planned.
Though in theory I thought calculating movement based on DeltaTime should result in pretty smooth animation regardless of the slight sound lag, but apparently not? Or maybe it’s just too easily noticeable in this kind of game.
Are you on iPad 1 or 2? The delay due to sound() is more noticeable on iPad 1 because of how expensive it is to compute the sound.
On iPad 2 myself, but then again the sound lag on picking up gems is not all that bad, as I guess you kind of expect something to happen when you pick it up something.
In 1.3, will we be able to “pre-cache” sounds without playing them? Say, to move the lag to the loading when framerate doesn’t matter all that much. Started thinking about background music as well, but I guess at that point I should probably move on to Objective-C anyway.
That’s great, @Drablos. I love the tilt control, and the thoughtful touches like the moment of safety when starting a new ship. Very nice.
We’ll see after 1.3. If you try it out and feel it’s still necessary to pre-cache them, perhaps we can add it. Or we can add the ability to play them at 0 volume, essentially just caching them.
Hi @Drablos, I enjoyed your game and got 300 points!
I have found with sounds that using DeltaTime will keep your object moving at the right speed, but it still will jerk across the screen during periods of high processing. This is because it has to skip some frames rather than play each one and slow down. So without using DeltaTime the object will be smoothly animated,but will sloooooow down during high processing.
@Simeon, just on the forthcoming sound API, perhaps I didn’t see it, but I can’t find an explicit volume control for sfxr. I did simulate volume with some changing of enevlopes etc, but wondered if that was something extra you would need to add?
@Fred you’re correct. I was actually thinking of adding a separate volume parameter to sound() in both modes that controls the OpenAL buffer gain.
@Simeon, a capital idea, I shall add it to the issue tracker.
When you die and at the ending when it says “game over; your score:…” How do you leave out of the game
he use displayMode(FULLSCREEN_NO_BUTTONS)
if you use air code , u cant leve the game @Iruizlopez137
Triple-tap with three fingers to exit FULLSCREEN_NO_BUTTONS.