Running Dino ( inspired by the Dino in Chrome browser ) in a very very simplified version.
This simplified version is only an animated one.
Here is the structure of the program :
1. Initialization
-load image : ground
-load image : dino
2. Main Program (Looping)
-define ESC key to quit
-moving background
-our main character :-) .... the one and only 'Dino'
It still needs improvement on these features that haven't been implemented yet :
- Animated running dino
- Jump over obstacle / cactus
- Avoid a flying bird
- etc.
You are most welcome if you are interested to improve this very simple 'Running Dino'
It's better to start with a simplified version to understand the logic before making it more sophisticated
Note : this code below has used 'set redraw off' .... 'redraw' to avoid flickering graphics as it was suggested by Marcus on the '1945 simplified' post / thread.
Code:
'INITIALIZATION
set window "Dino Simplified",640,480
set redraw off 'to avoid flickering graphics
load image 1,"data_dino/ground.png" 'length = 2400 px
load image 2,"data_dino/ground.png"
load image 3,"data_dino/dino1.png"
2. Main Program (Looping)
Draw the plane
Define keys : Esc to quit, Left and Right to move the plane
Draw enemies
Bullet is auto shoot
Still have miss lots of features ... somebody please add some code to detect collision between a bullet and an enemy, I am running out of idea on how to code collision detect
'MAIN PROGRAM
do
'SET BACKGROUND
cls
draw image 4,0,0
'THE PLANE
draw image 1,planeX,planeY
'ESC TO QUIT, LEFT AND RIGHT KEYS TO MOVE THE PLANE
if keydown(KEY_ESCAPE) then end
if keydown(KEY_LEFT) then planeX=planeX-speed
if keydown(KEY_RIGHT) then planeX=planeX+speed
'ENEMIES
for x=0 to 2
if enemyY[x]>480 then
enemyX[x]=rnd(640)
enemyY[x]=-rnd(50)
else
enemyY[x]=enemyY[x]+speed
endif
next
for x=0 to 2
draw image 3,enemyX[x],enemyY[x]
next
'BULLET, AUTO SHOOT
if bulletY < 480 then
bulletY = bulletY - speed*3
endif
if bulletY = 100 then
bulletX = planeX+15
bulletY = planeY
endif
I am attempting to "restock" my "to N7" conversions and have come across a bit of a puzzle in regards to "constant"
The error in line #10 seems to be objecting to "pr". If I change "pr" to the value of "pr", as in the previous constant, to 16 - "constant pr2 = 2 * 16" the error clears. Then the same error occurs for line #11 and 12. Keying in the actual value of "xmax" and "tl" clears the error.
Similar error for lines 14 and 15.
It looks like that constant does not like using or referring to a previous constant value.
Also, constant does not seem to like int(), in lines 14, 15 and 17.
Could there be an issue with 'constant' or perhaps I am doing this incorrectly... My money is on the latter... lol
I found the source code of a minsweeper game on a backup drive. I think it's for n5, but it might be even older than that. It's a short program, so translating it line by line to n7 only took me a couple of minutes. As with the Robowack translation, this code doesn't take advantage of the new stuff in n7. The original n5 source code is included.
I'm using a version of the wolf3d library that has not been released yet, but it's included in the zip. The support for loading maps created with the RC Editor (n6) is not complete yet, so some parts of the code may look a bit weird.
The lines in the original source code (robowack_n6_version.txt) match those in the n7 version (robowack.n7). So if you look at line 503 in the n6 code and wonder how to do that in n7, you can simply look at line 503 in the n7 version
I made some small changes to the game:
* The aspect of the window now matches that of the screen (monitor)
* Increased the field of view to 72 degrees
* Picking up a golden cross now gives you +5 health
I translated the n6 version line by line to n7, so the game does not take advantage of the "new stuff" in n7.
Here's Rock Blaster, source code included, by me. It was written in n5 though ...
The controls are weird. It's an asteroid style game that you control with the mouse. Hold down the right button and the ship will move towards the mouse cursor. Hold left mouse button to shoot.
Am I correct in assuming that "all" of those programs are gone? No chance that at least a few may have been tucked away on some forgotten drive somewhere? There are such a lot of cool games on that channel... It would be a shame if they were all lost... *sigh*
I will look through my old drives, just in case, but I cannot be sure that I have any of them... I think I may have the 'example' programs for N5 and N6 but that may be all... I will still look none the less...