Platform Game Draft

Hello, I’m new in Codea and was playing for 2-3 weeks. I decided to create a platform game draft. As I don’t have a Mac, Codea is just an experimental area to me for now but seems really cool. I used Platformer arts for the beginning and all the objects are randomly placed. Here is the first video:
https://www.dropbox.com/s/fi7g5xxhbm8gaq9/2013-11-09%2022.44.20.mp4
And here is the codes:
https://gist.github.com/barisdokudur/7397658
I know it’s a classical game structure but it’s just a beginning. I would really appreciate any suggestion if I could do anything in a better or easier way. (Sorry for my English…)

@Baris I just have to say… Wow, hats impressive for less then a months work of learning, was this self taught or tutorials?

Cool .

Thanks guys…
@Prynok
I’m new in Codea but not in programming. (not a professional developper, but self studied based on c# in the past) :slight_smile: I reviewed some of the tutorials and examples released in the forum, tried to learn the structure by preparing basic things first…

thanks for the share but it miss the pictures ( spikes, coinGold…)

@hpsoft
I’ve downloaded art set from the following site and it includes much more pictures than already implemented into Codea.
http://kenney.nl/post/platformer-art-assets-deluxe
Is there any way to link my Dropbox pictures to monitor in another Ipad?

put that game in CC. if you want

@hpsoft, spikes and coin are both included in Codea. Just change the readImage to use the ones from the built in PlatformerArt sprite pack.

Very nice. Just a quick suggestion- It looks like you’re using physics. When the player hits the floor, it bounces. You might try setting the restitution for both objects to 0.
Thanks!

@Luismi
I put the game into CC, if I didn’t do anything wrong :slight_smile: Thanks for your suggestion.

Until find a smart solution for the pictures, I add my Dropbox links:

Edit: pictures will be downloaded automatically with the last update.

@Zoyt

Yes, I use physics for ground, box and hero. I don’t remember well why I set restitution for hero and box as 0.3 although having 0 for ground :slight_smile: but anyway I will fix it. Thanks

Edit: Gold coin image in Codea does not work well, I realized that dimensions are different than I used. that’s why I updated the link.

@Ignatz @Luismi, thank you both :slight_smile: I think the codes in the link that Ignatz provided is working really well. Just a quick remark; in ImageDownloaded function, there is a syntax error on line 23 (most probabily copy+paste error in html) > should be replaced by >

Anyway, I finally update the codes and all pictures will be automatically downloaded from photobucket from now on. :slight_smile: I also released new version alpha1.1 in CC.

@baris - you can get Codea to download the images the first time. I did it this way, here

http://coolcodea.wordpress.com/2013/05/23/62-3d-downloading-images-on-demand/

You do have to be careful that when they download, you just get the image and not a whole HTML webpage page, which is a problem with some cloud services.

@baris man… This is awsome! You only needed to learn 3 weeks to create this! I almost have codea for half a year and i cant even make something like that.
You have talent.

@Ignatz thank you so much… This is what I was looking for during last few hours. :smiley:
I found some topics related to http.request but in my trials, problem was…

First, we’ll take all the code out of setup and put it in a function called setup2, because we don’t want it to run until the images are loaded. So setup will contain just one line of code

It’s too late for today but it will be first thing to do after return back to home tomorrow… :)>-

@Jessevanderheide thanks for your kind words :slight_smile: but I think mine is not a talent issue. If you have some background in programming (for loop, if, tables etc) and some knowledge on physics, maths, it’s much more easy than a complete beginner. But anyway, once you get the basics, everything will be running… I’ve also thousands things to learn. :slight_smile:

@baris. you could use the method http.request () to load pictures from your program without having to dear all directions of your photos. :slight_smile:

Http.request(URL your image , loadImage)

@Luismi - there can be some problems with that

  1. depending on where you have stored your image, you may get a whole web page instead of just the image (eg Dropbox)

  2. http.request is asynchronous, which means your code doesn’t wait for the image to be downloaded, but keeps going. When it tries to draw the image, crash! Your code needs to be made to wait for the download

That’s why I posted my link above, because it deals with those problems :smiley:

if the stored here: photobucket.com @ignatz

is true that I resorted to your link while. but I just do http.request’s call on images of my project Touchplay, and loaded without any problem :wink:

You did that in 2-3 weeks??

Wow… I’ve had codea over 2 months and can barely get a damn sprite to move. :frowning:

Impressive

Nice job.