Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 another game (for a friend)
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ecookman




PostPosted: Wed Oct 29, 2008 7:59 am   Post subject: another game (for a friend)

o.k i am working con a collab with a friend, A shooter-like program

stage1) get procedures for mouse x and y (completed)

stage2) make bad guys (completed)
stage3) make a [dot] for croshair (need help)

stage4) draw a dot on the screen at the mouse corr (need help)

stage5)killing them (complete sorta need help on other 2 to make rest of protocalls)



so if soeone could help us on stage 2 and stage3 that wold be greatly apprecieated

version of turing (4.1.1)




Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Wed Oct 29, 2008 8:00 am   Post subject: RE:another game (for a friend)

srry if u can't read sign it says ill send the completed copy and some bits to the most helpful (the finished game will be available too)
Warchamp7




PostPosted: Wed Oct 29, 2008 8:00 am   Post subject: RE:another game (for a friend)

It would help if you posted exactly what you're having problems with and what you've tried
ecookman




PostPosted: Wed Oct 29, 2008 8:19 am   Post subject: RE:another game (for a friend)

lol i don't have all of it we are building it in chuns and mashing it together but here is my part:



Turing:

Mouse.ButtonChoose("multibutton")
var x : int
var y : int
var button : int
var none : int
var left : int
var middle : int
var right : int
    none := 0
    left := 1
    middle := 10 
    right := 100
loop
    Mouse.Where (x, y, button)
    locate (1, 1)
    put "X:", x, " Y:", y
    if button = none then
        put "shoot! ", button
    elsif button = left then
        put "blam! ", button
    elsif button = middle then
        put "scroll wheel does nothing ", button
    elsif button = right then
        put "Right click does nothing ", button
        end if
    if x=90 and y=120 and button = left then
       drawfilloval(90, 120, 75, 75, red)
    end if
end loop
ecookman




PostPosted: Wed Oct 29, 2008 8:20 am   Post subject: RE:another game (for a friend)

ya so basically where:
if x=90 and y=120 and button = left then
drawfilloval(90, 120, 75, 75, red)

is we want that to be the x and y of the mouse and to have the mouse to be a small cicrcl



p.s. Full Metal Alchemist rules love u avvi
CodeMonkey2000




PostPosted: Wed Oct 29, 2008 8:54 am   Post subject: RE:another game (for a friend)

Please use either the code or syntax tags when you post code next time. And about your problem, I'm not sure what you mean.
Warchamp7




PostPosted: Wed Oct 29, 2008 9:07 am   Post subject: Re: RE:another game (for a friend)

ecookman @ Wed Oct 29, 2008 8:20 am wrote:
ya so basically where:
if x=90 and y=120 and button = left then
drawfilloval(90, 120, 75, 75, red)

is we want that to be the x and y of the mouse and to have the mouse to be a small cicrcl


What this code is going to do is draw a circle ONLY when the mouse is at x=90 and y=120 and when the mouse button is down.

Just do

Turing:

if button = left then
drawfilloval(x, y, 75, 75, red)
end if


You'll need to couple this with a delay though for individual shots otherwise you can just drag the mouse around and rapidly fire.
S_Grimm




PostPosted: Wed Oct 29, 2008 9:24 am   Post subject: RE:another game (for a friend)

what you need to do is this
Turing:

View.Set("offscreenonly")
var x, y, z : int
loop
cls
Mouse.Where (x,y,z)
Draw.FillOval(x,y,10,10,red)
View.Update
end loop
Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Wed Oct 29, 2008 10:51 am   Post subject: RE:another game (for a friend)

umm what is the z variable for
ecookman




PostPosted: Wed Oct 29, 2008 10:55 am   Post subject: RE:another game (for a friend)

WOOT that worked now how do i mkae the mouse go away
pkjr92




PostPosted: Wed Oct 29, 2008 12:05 pm   Post subject: Re: another game (for a friend)

I already had a template made for these games. Here it is:

code:

%Sniper Control Template
%Created by: Josh Guerette
%October 29, 2008
%This template is free to use as long as proper credit is givent to its creator
View.Set ("graphics, offscreenonly, nobuttonbar")
var x,y,c:int
var reload:int
reload:=0
var shots_left:int:=10
var key:array char of boolean
var alreadyshot:int

loop
alreadyshot:=0
colorback (black)
Text.Color (white)
mousewhere (x,y,c)
%put "x= ",x
%put "y= ",y
%put "click= ",c
View.Update
cls
put "Shots Left: ",shots_left
if c=1 and alreadyshot=0 then
    shots_left-=1
    alreadyshot:=1
    delay (100)
end if
if shots_left=0 or shots_left < 0 then
shots_left:=0
put "Enter - RELOAD"
end if
if shots_left > 10 then
put "RELOADED"
shots_left :=10
end if

Input.KeyDown (key)
if key (KEY_ENTER) and shots_left = 0 then
    shots_left:=10
   
end if

drawoval (x,y,50,50,48)
drawline (x,y-50,x,y+50,48)
drawline (x+50,y,x-50,y,48)
drawbox (x-5,y+5,x+5,y-5,brightred)



end loop
S_Grimm




PostPosted: Wed Oct 29, 2008 1:35 pm   Post subject: RE:another game (for a friend)

z is for the status of the button (ie if the mouse is clicked down or not.)
[Gandalf]




PostPosted: Wed Oct 29, 2008 6:40 pm   Post subject: Re: RE:another game (for a friend)

ecookman @ 2008-10-29, 10:55 am wrote:
WOOT that worked now how do i mkae the mouse go away

You can't. The mouse pointer is drawn by the Windows API, which Turing doesn't have access to. Of course, you could do it a roundabout way like Sys.Exec()ing a program that hides the mouse cursor for you, but that's more trouble than it's worth.
ecookman




PostPosted: Thu Oct 30, 2008 7:19 am   Post subject: RE:another game (for a friend)

WELL THAT IS A PAIN INT THE BUTT

but thanks now i can stop googling
ecookman




PostPosted: Thu Oct 30, 2008 7:41 am   Post subject: RE:another game (for a friend)

HMMMMM just tinking


is it possibl;e to load a background from a file to load it into turing
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: