Beginnings of the Wayward Programmer
(define BOARDWIDTH 200) (define BOARDHEIGHT 200) (define STARTPOSITION 50) (define BOARDBKGR "blue") (define GAMEBOARD (empty-scene BOARDWIDTH BOARDHEIGHT BOARDBKGR)) (define ROCKET .) (define UFO (overlay (circle 10 "solid" "red") (rectangle 40 4 "solid" "green"))) (define FLATBED (rectangle 60 10 "outline" "black")) (define (SPACESHIP option) (cond [(= option 1) ROCKET] [(= option 2) UFO])) (define SHOWNSHIP (SPACESHIP 1)) (define V 10) ;Velocity (define A 1) ;Acceleration (define (distance t) ;t = Time (- (* V t) (* 1/2 A (sqr t)))) (define SPACESHIP-BOTTOM (- BOARDHEIGHT (/ (image-height SHOWNSHIP) 2))) (define (render-shownship x y) (place-image SHOWNSHIP x y GAMEBOARD)) (define (create-rocket-scene.v7 t) (cond [(<= (distance t) SPACESHIP-BOTTOM) (render-shownship STARTPOSITION (distance t))] [(> (distance t) SPACESHIP-BOTTOM) (render-shownship STARTPOSITION SPACESHIP-BOTTOM)]))
This code is based off of Chapter 1 of HTDP. I've gotten this far and it wasn't as bad as last time. And it's been 5 years (I can't believe it) since I've touched this language. The only issues I have really are two things.
- I couldn't find a way to do one of the suggestions. Which was: How would change the program so that the rocket lands on a flat rock bed that is 10 pixels higher than the bottom of the scene? Don’t forget to change the scenery, too. When I tried adding another function call to render-shownship, I kept getting an error.
- The spaceship goes down to the bottom of the screen, then accelerates up the screen. I'm a bit lost on why that is.
Outside of those two things. I'm quite happy with my progress. I've thankfully gotten over the prefix issue as well, lol.
The story will be told from the eyes of different characters. It won't be all one person.
For instance, in Lesson One, the viewpoint goes from the Pupil (or young one, as the Master referred to him) to the two Observers. I hope to not make the transitions too confusing or confusing at all.
As each Lesson is posted, right now in Writing for Games forum, I will post a link here as well. Also, each Lesson will have a link to the next lesson. Drafts or incomplete work will be posted here and the finished work in the Writing for Games forum.
I don't expect the stories to be great and spectacular on my first go around. But I hope for them to be at least decent and enjoyable.
So in advance, thank you for reading [smile]
After my degree, I believe I'm going to go through all the Workshops and my Ultimate Japanese book. By 2008, this time I hope my algorithm, problem-solving, and programming skills improve greatly. Hopefully all this relearning and refining, gives me time for martial arts and an actual life.
Well to all Happy Thanksgiving. And feel free to tell your experiences during this last year or just about growing in general.
**shakes fist, with flames bursting from wrist and brimstone hailing onto Silicon Valley**
Right now this is a just a demo. This sorry excuse for 1s and 0s has MegaMan and PharaohMan. All MegaMan can do shoot and jump--but not both at the same time--and run. PharaohMan just shoots randomly and teleports to different sides of the room when hit.
Hopefully I hope to have this implemented:
- MegaMan can jump & shoot and run & shoot
- Some sort of simple physics when either character gets hit
- better shooting animation for PharaohMan (check! 5/07)
- score and energy bars
- either scrolling of the background or dynamic background
For now, just download, shoot at PharaohMan, then delete [grin]
Thanks for reading (and hopefully downloading).