The Daily Click ::. Forums ::. Misc Chat ::. Tired of making games/apps alone?
 

Post Reply  Post Oekaki 
 

Posted By Message

Danny Boy



Registered
  06/10/2003
Points
  794
17th January, 2004 at 19:53:09 -

Tired of making games/apps alone? Then join the Dynecys group! www.dynecys.rr.nu
These are wanted there: Artist, BETA tester, programmer(mmf,tgf,.asp,.jsp), help file-writer and game maker<-(most wanted)

 

CYS

Oldie

Registered
  03/01/2002
Points
  1523

VIP Member
17th January, 2004 at 20:17:16 -

It feels really weird when you have my name as part of the group's name.

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
17th January, 2004 at 21:05:55 -

Nice site, but what else does your group have that the other groups don't have?

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Dogzer



Registered
  07/02/2011
Points
  1029
17th January, 2004 at 23:39:22 -

yeah i would like to have someone to help with this:

Global Start_time# = MilliSecs()

;Tile
Global tile_width = 42
Global tile_height= 14
Global tile_depth = 22
Global t_halfwide = tile_width / 2
Global t_halfdeep = tile_depth / 2

;Cursor & cam
Global cam_x = 0
Global cam_y = 0
Global cam_x_speed = 0
Global cam_y_speed = 0
Global cursor_x = 0
Global cursor_y = 0
Global cursor_z = 0
Global cursor_real_x
Global cursor_real_y

;Screen
Global screen_width = 640
Global screen_height = 480
Global screen_depth = 16

Global screen_img_width = 200
Global screen_img_height = 200

Global screen_img_ammount = 0

Graphics3D screen_width,screen_height,screen_depth,2
SetBuffer BackBuffer ()

;=============================================================
;=============================================================
;=======================GFX LOAD==============================
;=============================================O.o;============
;=============================================================

Global sand_gfx = LoadImage ("tile_sand.bmp")
MaskImage (sand_gfx,255,0,255)

Global cursor_gfx = LoadImage ("cursor.bmp")
MaskImage (cursor_gfx,255,0,255)

Global cursor_height_gfx = LoadImage ("cursor_height.bmp")
MaskImage (cursor_height_gfx,255,0,255)

DebugLog "gfx loaded"

crate_cursor(4,2,0)

set_scene_img()
draw_on_scene_img_1st()

;=============================================================
;=============================================================
;=======================MAIN LOOP=============================
;=============================================O.o;============
;=============================================================

While (Not KeyHit(1))

main_loop_start# = MilliSecs ()
Cls

move_cursor()
update_curor()
crate_on_keyhit()
draw_on_scene_img_1st()
draw_scene()

While (MilliSecs () < main_loop_start# + 10) Wend

Text 0,15, "fps: " + 1000 / (MilliSecs() - main_loop_start#)
Text 0,30, "cursor x: " + cursor_x + " cursor y: " + cursor_y + " cursor z: " + cursor_z + " || camera_x: " + cam_x + "camera_y: " + cam_y
Text 0,45, "Use the cursor keys to move the red cursor, also change cursor height with A/Z keys. kthx."
Text 0,60, "Ammount of immages: " + screen_img_ammount

Flip

Wend

;=============================================================
;=============================================================
;=======================TYPES=================================
;=============================================O.o;============
;=============================================================

Type tile

Field x
Field y
Field z
Field screen_x
Field screen_y
Field gfx

End Type

Type img

Field x
Field y
Field gfx
Field needs_update

End Type

;=============================================================
;=============================================================
;=======================FUNCTIONS=============================
;=============================================O.o;============
;=============================================================

Function set_scene_img()
; if this function is ran twice, all images must be deleted
For scene_img.img = Each img
Delete scene_img
Next

x_division = screen_width / screen_img_width
y_division = screen_height / screen_img_height

For x = 0 To x_division - 1
For y = 0 To y_division - 1

scene_img.img = New img
DebugLog "img created"
screen_img_ammount = screen_img_ammount + 1
scene_img\x = x * screen_img_width
scene_img\y = y * screen_img_height
scene_img\gfx = CreateImage (screen_img_width, screen_img_height)
scene_img\needs_update = 1

Next
Next

End Function

Function update_curor()

;delete cursor
For in_zone.tile = Each tile

If in_zone\gfx = cursor_height_gfx Or in_zone\gfx = cursor_gfx Then Delete in_zone

Next
;create cursor again
crate_cursor(cursor_x,cursor_y,cursor_z)

End Function

Function draw_on_scene_img_1st()

For scene_img.img = Each img
;check if scene needs update

If (scene_img\needs_update = 1)
;choose the image as buffer so I can draw on it
SetBuffer ImageBuffer (scene_img\gfx)
;clear up
Cls

;draw all in_zone tiles, including cursors
For in_zone.tile = Each tile

DrawImage (in_zone\gfx,in_zone\screen_x - cam_x - scene_img\x ,in_zone\screen_y - cam_y - scene_img\y)

Next
;now that drawing is done, it doesnt need updating
scene_img\needs_update = 0

End If

Next

SetBuffer BackBuffer ()

End Function

Function draw_scene()
For scene_img.img = Each img

DrawImage (scene_img\gfx, scene_img\x, scene_img\y)

;crap below
Plot MouseX(), MouseY()

ClsColor Rnd (80), Rnd(50), Rnd(90)
Next

If is_point_inside_rect(MouseX(),MouseY(),0,0,320,480)
Color 255,0,0
Else
Color 0,255,0
End If
;crap above

End Function

Function crate_in_zone(x,y,z,gfx)

in_zone.tile = New tile
in_zone\x = x
in_zone\y = y
in_zone\z = z
in_zone\screen_x = (x * t_halfwide) - (y * t_halfwide)
in_zone\screen_y = (y * t_halfdeep) + (x * t_halfdeep) - (z * tile_height)
in_zone\gfx = gfx

real_x = (x * t_halfwide) - (y * t_halfwide)
real_y = (x * t_halfdeep) + (y * t_halfdeep) - (z * tile_height)

For scene_img.img = Each img
If is_point_inside_rect(x,y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If
Next
End Function

Function crate_cursor(x,y,z)

cursor_x = x
cursor_y = y
cursor_z = z

in_zone.tile = New tile
in_zone\x = x
in_zone\y = y
in_zone\z = z
in_zone\screen_x = (x * t_halfwide) - (y * t_halfwide)
in_zone\screen_y = (y * t_halfdeep) + (x * t_halfdeep) - (z * tile_height)
in_zone\gfx = cursor_gfx

For z_value = 0 To z - 1

in_zone.tile = New tile
in_zone\x = x
in_zone\y = y
in_zone\z = z_value
in_zone\gfx = cursor_height_gfx
in_zone\screen_x = (x * t_halfwide) - (y * t_halfwide)
in_zone\screen_y = (y * t_halfdeep) + (x * t_halfdeep) - (z_value * tile_height)

Next

For z_value = 0 To -z - 1

in_zone.tile = New tile
in_zone\x = x
in_zone\y = y
in_zone\z = -z_value
in_zone\gfx = cursor_height_gfx
in_zone\screen_x = (x * t_halfwide) - (y * t_halfwide)
in_zone\screen_y = (y * t_halfdeep) + (x * t_halfdeep) - (-z_value * tile_height)

Next

End Function

; MOVE CURSOR FUNCTION START
Function move_cursor()

If KeyHit (203)
cursor_x = cursor_x - 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

If KeyHit (205)
cursor_x = cursor_x + 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

If KeyHit (200)
cursor_y = cursor_y - 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

If KeyHit (20
cursor_y = cursor_y + 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

If KeyHit (30)
cursor_z = cursor_z + 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

If KeyHit (44)
cursor_z = cursor_z - 1

cursor_real_x = (cursor_x * t_halfwide) - (cursor_y * t_halfwide)
cursor_real_y = (cursor_x * t_halfdeep) + (cursor_y * t_halfdeep) - (cursor_z * tile_height)

For scene_img.img = Each img

If is_point_inside_rect(cursor_x,cursor_y,scene_img\x,scene_img\y,scene_img_width + tile_width ,scene_img_heigh + tile_height + tile_depth)

scene_img\needs_update = 1

End If

Next

End If

End Function

;MOVE CURSE FUNCTION END_ its a bit long function

Function crate_on_keyhit()
If KeyHit (57) Then crate_in_zone(cursor_x,cursor_y,cursor_z,sand_gfx)
End Function

Function is_point_inside_rect(x,y,rect_x,rect_y,rect_width,rect_height)
a = 0
If ( x > rect_x And x < rect_x + rect_width And y > rect_y And y < rect_y + rect_height )

a = 1

End If

Return a

End Function


 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
18th January, 2004 at 00:07:14 -

Darn it, Dogzey, take your code somewhere else. Putting up all that bare code is as bad as porn to some people around here.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Dogzer



Registered
  07/02/2011
Points
  1029
18th January, 2004 at 00:31:30 -

what.. its just a bit of code someone help me

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
18th January, 2004 at 01:08:49 -

A bit? Which part do you need help with exactly?

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
18th January, 2004 at 04:29:24 -

lol Dogzer, your problem is in line 100000101010

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

Keatonian



Registered
  15/07/2002
Points
  571
18th January, 2004 at 11:29:42 -

Exactly right CC

 
-Above post is ancient and probably irrelevant-

An old account of mine, recently cleared out. It's a blast to the past, the age was marked as 14 when I found it. If you know where to look, you can track me. Au revoir.

Dogzer



Registered
  07/02/2011
Points
  1029
18th January, 2004 at 15:16:25 -

hehe CC you gave me the line in binary code <3

 
n/a

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
18th January, 2004 at 15:30:17 -

I refuse to work with any language that relies on white space.

 
gone fishin'

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
18th January, 2004 at 15:45:20 -

I might join, but what I want to know is: what are you working on? Anyway:
I know: TGF/MMF, TrueBasic, Visual Basic.
Strenghts: Fighting engines and coding.

Image Edited by the Author.

 
http://www.klik-me.com

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
18th January, 2004 at 16:08:40 -

What programming language is that Dogzer?

It looks like it's either C++ or Jamascript.

Either way, I know only the basics.



 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
18th January, 2004 at 16:14:29 -

Looks like a BASIC style language, C syntax languages have braces instead of 'then' and 'end if' etc.

 
- Tigerworks

Cybermaze



Registered
  03/04/2003
Points
  853
19th January, 2004 at 04:51:43 -

Dogzer if you put a link instead anyone interested could see your code, and all the others could navigate this topic faster. Dont you think such a question should be in the help section?

 
If you knew, I would have to kill you...
   

Post Reply



 



Advertisement

Worth A Click