A very alpha beginning...

RWBRWB Icrontian
edited June 2004 in Internet & Media
It's a game I am still developing, right now all you can really do is place a couple buildings within the grid, which it will snap to. Eventually it will become a much larger game.

No it isn't fun yet, but I'm having fun ;D

Please give me your suggestions and comments... knowing it does look like crap at the moment ;) BTW I managed to pull this off in only one page of script.. it's messy but this is it:

Don't mind the comments(noted with a "--")
--global curX, curY, curSpt
--
--on beginSprite me
--
-- -- IN ORDER to add scripts to dynamically created sprites, you need to look at
-- -- a property called the "scriptInstanceList"
--
--
--
-- curX = 10
-- curY = 10
-- curSpt = 1
-- repeat with row = 1 to 9
-- repeat with columns = 1 to 11
-- sprite(curSpt).puppet = true
-- sprite(curSpt).ink = 8
-- sprite(curSpt).memberNum = 1
-- sprite(curSpt).locH = curX
-- sprite(curSpt).locV = curY
-- curX = curX + 60
-- curSpt = curSpt + 1
-- end repeat
-- curX = 10
-- curY = curY + 60
-- end repeat
--end me
--
--
--on exitFrame me
-- go the frame
--end


global piece, obj, building

on beginSprite me
piece=350 --the buildings being put down
obj="bldg_one"
building=sprite(500)
building.member=obj
end

on exitFrame me
building.loc=the mouseLoc
building.ink=8 --background transparent
building.blend=100 --unsure, ask Scott
-- oldZ = building.locZ
-- building.locZ = 1000
-- put the rollover
-- building.locZ = oldZ
go the frame
end

on mouseUp me



--unsuccessful script
-- if sprite(25).loc.inside.rect=the mouseLoc then obj="bldg_one"
-- if sprite(26).loc.inside.rect=the mouseLoc then obj="bldg_two"
--
--checks sprite channels 350 through 450 to see if the
--building being placed intersects with any of the newly laid sprite's from sprite channels 350 up to 450.
repeat with p=350 to 450
if building.intersects(p) then return
end repeat


repeat with grid=50 to 300
if sprite(grid).memberNum>0 then
if building.loc.inside(sprite(grid).rect) then
targetLoc=sprite(grid).loc
sprite(piece).puppet=TRUE --puppet gives control to lingo to a sprite not on the stage
sprite(piece).member=obj
sprite(piece).ink=8 --background transparent
sprite(piece).blend=100 --unsure, ask Scott
sprite(piece).locZ=49 --layers for each "piece" being laid down
sprite(piece).loc=targetLoc --
piece=piece+1
exit repeat
end if
end if
end repeat

building.member=obj


--sprite(piece).puppet=TRUE
--sprite(piece).member=obj
--sprite(piece).ink=36
--sprite(piece).blend=100
--sprite(piece).locZ=49
--sprite(piece).loc= targetLoc
--piece=piece+1

on keydown me
if the keycode=18 then obj="bldg_one"
if the keycode=19 then obj="bldg_two"
building.member=obj
end


--don't forget a centering script!!!

Comments

  • RWBRWB Icrontian
    edited June 2004
    Ohh yeah, the commented out stuff above the "global piece, obj, building" part is actually a script I am working on for a randomized map generator. A decent appearance should be ready by Wednesday.
  • RWBRWB Icrontian
    edited June 2004
    I forgot to add that you must press "1" or "2" on your keyboard, not the keypad, for the 2 different building selections.
  • mmonninmmonnin Centreville, VA
    edited June 2004
    Scott must be the smart one then?;)

    building.blend=100 --unsure, ask Scott
    sprite(piece).blend=100 --unsure, ask Scott

    What language is that?
  • RWBRWB Icrontian
    edited June 2004
    yeah Scott, my lab instructor, helped with collision detection and initial issues I had with the game. The language is "Lingo" a propoetary language similar to action script, for Director which is similar to Flash, but more built for Kiosks and CDROM hybrids and stuff. Plus those online Shockwave games of various sorts. Many many things...

    I had a BITCH of a time with collision detection, it wound up being a short bit of code:

    repeat with p=350 to 450
    if building.intersects(p) then return
    end repeat

    350 to 450 being the sprite channels that get the buildings placed, a total of 100 buildings max. I'll be rewriting all my code before I turn it in, I was thinking of redoing the whole thing in OOP. Which would be required if I went through with building a whole game like this. And yes, Scott is the smart one, a genious with this stuff ;)

    Those two lines you have with scotts name in them are actually the same thing, I was testing various ideas using it... things are a real bitch right now cuase I am still so new at this. I was able to figure out what it does, it allowed me to have oddly shaped objects be placed properly around each other, like in Building # 2 which has a kind of inlet to it, otherwise it would be treated as a normal rectangle. It works like a blending mode in photoshop.

    The project so far is a total mess as you can see, and a bitch to look at and try to figure out what you were doing the day before LOL
Sign In or Register to comment.