Archive for June, 2005

June 30th 2005

ADHOC/MacHack Again

Heh… Wow, I posted a blog entry a week ago, and didn’t look at the result on the site. I swear I had more than one sentence in my last post, not sure where it went though.

Well, as I started out below, ADHOC/MacHack 20 is only a little over a month away. However, I’ve decided what I’m going to talk about, and it’s going to be some good times. I decided to do a session titled, “Write a Cross-Platform Game in Two Hours.” I came up with the idea based on some feedback around the REAL Software offices, and we decided a good game to do would be Battleship.

Why battleship? A few reasons:

  1. It has simple rules.
  2. The rules have already been determined (this session isn’t about game design, it’s about writing a game that’s been designed)
  3. It’s inherently multi-player. REALbasic’s networking classes are very powerful and easy to use, making this a unique item to add to something developed in just a few hours.
  4. Battleship is basically 2D. While I am going to be getting OpenGL acceleration, z-layering, and full transparency through John Balestrieri’s SuperSpriteSurface, 3D just complicates what can be done in a couple of hours. So, the game will run great using OpenGL, but will remain 2D.

Basically, we can focus on REALbasic, the object model, the language, and the IDE while creating something fun.

So, if that interests you, I encourage you to check out ADHOC. The early bird registration deadline is today, and after then it will be $50 more. There may be a few more spots available for those who want to speak, and you get a discount for speaking. If you are coming, let me know so that I can keep my an eye out for you at the conference!

3 Comments »

June 21st 2005

ADHOC/MacHack 20

Well, ADHOC/MacHack 20 is only a little over a month away, and I haven’t quite decided what my last session is covering. 1 Comment »

June 14th 2005

2005: For loop syntax

Here’s the first RB2005 update for the blog. My favorite 2005 features lie in the compiler. I write code, and the easier the code is to keep clean, the happier I am. So, there are two technologies at work for this update:

Block-level dims

Block-level dims mean that you can now place “dim” statements inside of blocks such as “If”, “For”, “Try”, and they will only be accessible inside of that block. For example:

Dim i As Integer
If i = 0 Then
Dim foo As Integer
// foo can be used here
End If
// Foo can't be accessed here

This is a wonderful feature, because it allows you to keep the “dim” statements closer to where you actually use them, which means it’s easier to refactor your code in the future.

With this support, a few things automatically work. For Try-catch blocks, the exception is now a member of the block, so the names can be reused in future blocks. For example, this code wouldn’t work in 5.5 because the “catch” statement uses the same names, but in 2005 it works:

Try
// raise an exception
Catch exc As RuntimeException
End Try
Try
// raise an exception
Catch exc As RuntimeException
End Try

Finally, we added a nice feature for “For” loops. A common thing to ensure that your code doesn’t rely on the counter for a loop outside of the loop is to use a loop counter that is only scoped to the loop itself. Until RB2005, that wasn’t possible. In REALbasic 2005, you can now create variables inside of the For statement so that you don’t have to “dim” them outside. For example:

For i As Integer = 0 To ubound( myArray )
// use i
Next
// "i" can't be used anymore

Similarly, the same syntax is available for the “For each” loop:

For Each s As String In myStringArray
// use s
Next
// "s" can't be used anymore

The above compiler features are a small subset of the new features in 2005, but they are some of my favorite ones :) Enjoy!

1 Comment »

June 5th 2005

WWDC 2005

Well, in four hours I’m heading off to WWDC. Anyone else going? If so, let me know who I should keep an eye out for!

I’m using Apple’s attendee site to put together my agenda, which is making me even more excited to get there. There’s a lot of great sessions I’m looking forward to, and plus, there’s the rumors about the Apple-Intel thing (which my opinion is simply that switching to Intel doesn’t mean that they switch to x86). I also have a feeling there’s something big that no one’s anticipated yet.

Anyways, updates will be sparse until next weekend. I do have mobile-blogging ready to go on my PocketPC, but I have to be inspired to write something :)

1 Comment »